I have a Spring MVC controller set up like so:
@RequestMapping("activityChart")
public ModelAndView activityChart(
@RequestParam(required=false, value="parent") String parent,
@RequestParam(required=false, value="expand") String[] expand,
@ModelAttribute PaginationArgs paginationargs) throws IOException {
// ... return template renderer
}
Where PaginationArgs is a two-field POJO. I want to construct a URL string that includes values for paginationargs
. It's easy to do for parent
and expand
- activityChart?parent=foo&expand=bar&expand=baz
, but what's the right way to encode a POJO's fields?
JSP takes care of this in Spring with a <form:form modelAttribute='paginationargs'>
tag, but our project isn't using JSP but Jamon instead.