Announcement Announcement Module
No announcement yet.
SimpleFormController and populating values Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • SimpleFormController and populating values

    I've a jsp page which is configured as FormView of a SimpleFormController. IN the jsp, i have a drop down box of which the values are coming from database. Now my question is how to populate the drop down box?

    Using simpleformcontroller, i'm unable to achieve what i mentioned above.

    Thank you so much for any help. I really appreciate it.

  • #2
    Just implement the referenceData method and set the drop down values there. Check also the Spring form tags reference Study the select and options part.

    protected Map referenceData(HttpServletRequest request, Object command,
    			Errors errors) throws Exception {
        	Map referenceData = new HashMap();
            List yourList = new ArrayList();
            // populate yourList choices here...
            referenceData.put("", yourList);
            return referenceData;
    There are 100+ questions and answers regardinding how to use the select/options tags. Please read the older posts aswell.


    • #3
      Thanks Noon.

      I could able to implement the referenceData and able to populate the drop down values using just one SimpleFormController.

      I used the following thread as the reference for implementing my logic.

      Thanks again.