Results 1 to 2 of 2

Thread: Equivalent of bindonnewform in annotated form controller

  1. #1
    Join Date
    Apr 2006
    Location
    London
    Posts
    82

    Default 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. #2
    Join Date
    Apr 2006
    Location
    London
    Posts
    82

    Default

    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");
        }

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •