PDA

View Full Version : unable to call onsubmit () implicitely


gaddamsandeeps
Jul 12th, 2007, 07:09 AM
when am running my project onsubmit is not calling .but form formBackingObject
was calling but i ned onsubmit() to call implicitely.

this is my code in SimpleFormController
----------------
public class HelloFormController extends SimpleFormController{
public ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors){
System.out.println("onsubmit()===========");
String increase = ((Hello) command).getId();
System.out.println(increase+"id from submit()=======");

return new ModelAndView(getSuccessView());
}

protected Object formBackingObject(HttpServletRequest request)
throws ServletException {
System.out.println("formback()=================");
Hello hello = new Hello();
hello.setId((String)request.getAttribute("id"));
return hello;

}




}
-plz help me quickly

ozGuy
Jul 12th, 2007, 07:47 AM
Hi
If onsbumit is not getting called this could be due to many things: check if you have got the following correct
1. action url on form
2. mapping of the form action to the controller
3. the method on the form is post

How does your form look like ?

noon
Jul 12th, 2007, 08:54 AM
or you have binding errors on your form. Check the Errors-object for any binding / validation errors.

gaddamsandeeps
Jul 12th, 2007, 09:51 AM
i had changed form method to post from get so i got the result