views:

175

answers:

1

I am trying to call submit action from javascript using simpleFormController of Spring but action calling only handleRequest but its not calling the onsubmit action

+1  A: 

As Bozho says, it would help to see some code. However, my experience is that when onSubmit is not being called, it's usually because the request is showing up as a GET rather than a POST; by default the controller determines whether a request is a form submission by looking for a POST.

Two ways to fix it: 1) make it a POST (i.e. submit a form via javascript, say) or 2) override isFormSubmission to use some other criteria for deciding whether a given request is a form submission -- for example, you might want to say that if a certain parameter is present, the request should be treated as a form submission, even if it's a GET request.

JacobM