I have the following GET request:
/api/search?filter.operation=Ping&filter.namespace=
Note that parameter names include the prefix ( filter. , Filter. ).
Then I have the following bean that I want to use to get these parameters:
class MessageSearchFilter { String operation; String namespace; ... }
And the handler method has the following signature:
public @ResponseBody String searchMessages(MessageSearchFilter filter, ...);
However, this does not work as Spring MVC expects the "operation" and "namespace" attributes to be named that way. It works if I change my request to use "operation" and "namespace" (without the prefix "filter.").
Is there any way to tell Spring to prefix the parameters with a filter?
A related side question: what happens if I have a method signature with multiple form objects with names of colliding properties?
spring spring-mvc spring-3
jjmontes
source share