Announcement Announcement Module
No announcement yet.
Binding a HashMap object in Spring MVC? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • 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:['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!