-
Bug
-
Resolution: Done
-
Major
-
2.3.4.Final, 2.3.5.Final
-
None
Using @Form and @FormParam, it is not possible to have RESTEasy inject values to a Map when the request parameter names are non-alphabetic. For instance, if we have a request parameter:
myMap[b794c4a0-14b7-0130-c2da-20c9d04983db].bar=test
And @Form/@FormParam annotated classes:
public class MyForm { @Form( prefix = "myMap" ) private Map<String, Foo> myMap = Maps.newHashMap(); } public class Foo { @FormParam( "bar" ) public void setBar( final String bar ) { ... } }
And a resource accepting a form-url-encoded POST:
@Path( "/test" ) public class MyController { @Consumes( MediaType.APPLICATION_FORM_URLENCODED ) @POST public void doPost( @Form final MyForm myForm ) { ... } }
The myForm.myMap will not have an entry with a key "b794c4a0-14b7-0130-c2da-20c9d04983db".
It looks like the problem occurs because of a regex in MapFormInjector. The regex ("^" + prefix + "\\[([a-zA-Z_]+)
]") only allows alphabetic characters and underscore characters when matching form parameters.
- is related to
-
RESTEASY-806 Upgrade RESTEasy to support Map and List @Form since 2.3.5.Final
- Closed
-
RESTEASY-807 ListFormInjector will throw IndexOutOfBoundException if the request not coming in sorted order.
- Closed