Announcement Announcement Module
Collapse
No announcement yet.
Equivalent of bindonnewform in annotated form controller Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Equivalent of bindonnewform in annotated form controller

    As SimpleFormController is deprecated since Spring 3.0, can someone point me in the right direction to achieve the equivalent of "bindonnewform = true" using annotations?

    I want to pass in parameters to the form and have those automatically bound to my command object without manually having to do the binding myself.

    Thanks

  • #2
    I did this by doing the below

    Code:
        @RequestMapping(method = RequestMethod.GET, params = {"isAmend=true", "!isSubmit"})
        public ModelAndView amendSearch(@ModelAttribute("form") SearchForm searchForm, BindingResult result){
            return new ModelAndView("searchForm");
        }

    Comment

    Working...
    X