1

In Spring 2.5; there is SimpleFormController having method

    @Override
        protected Object formBackingObject(HttpServletRequest request) throws Exception {
            //logic for command object

}

What is its alternative in Spring mvc 3. I want to load command object in a jsp page form.

1 Answer 1

3

Use @ModelAttribute

@ModelAttribute
public MyFormObject createForm(HttpServletRequest request){

}

Would work without the request also

@ModelAttribute
public MyFormObject createForm(){

}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.