Announcement Announcement Module
Collapse
No announcement yet.
Binding a HashMap object in Spring MVC? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Binding a HashMap object in Spring MVC?

    Hey guys,

    Is it possible to bind a HashMap object (via the @RequestParam annotation) in a Controller? Specificially, I'm wanting to do something like the following:

    http://www.url.com/page?map['key']=value

    and have something like:

    @RequestMapping(value = "/page", method = RequestMethod.GET)
    public void process(Map<String, Object> model,
    @RequestParam(value="map") HashMap<String, String> map)

    for my method header. Are there built-in editors available to get this conversion to work? Right now, I have the above and I'm only getting a null object for "map" after setting the required=false on it.

    Thanks for the help!
Working...
X