vendredi 23 septembre 2016

Java EE / Spring decoding application/x-www-form-urlencoded format, is possible?

When

jQuery.ajax({ ... 
     data: { 
           search: {input : 'value'} 
           array : [1,2]

     }
}

The method will request the url:

url?search[input]=value&array[]=1&array[]=2

which follows the application/x-www-form-urlencoded format from what I understand.

But the JEE application, which uses Spring can not turn this into a HashMap for search or array[] on key array on the server side.

Instead this is what we get,

enter image description here

Is there a way to add filter in Java EE to participate in the creation of the request.getParameterMap() ?

Are there any such filters already written and available as opensource?

Any other thoughts?




Aucun commentaire:

Enregistrer un commentaire