-
Notifications
You must be signed in to change notification settings - Fork 38.4k
invalid doSubmit method executed for SimpleFormController [SPR-794] #5521
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Mike Zupper commented this method:
causes the problem: see the attached file. |
Juergen Hoeller commented Sorry, I have no clue what kind of misbehavior you're experiencing here. SimpleFormController simply delegates through the onSubmit chain from the version with all arguments down to the version with a single argument. This has been that way for a long time and has always worked, so I suspect that some side effect is happening in your case. Could you try to isolate the problem and submit a reproducible test case? Juergen |
Juergen Hoeller commented See the comments on the linked issue. A likely cause is that you imported the wrong BindException class: it needs to be org.springframework.validation.BindException, not java.net.BindException. If the wrong class is used in the method signature, the method doesn't actually override the one in the superclass, and thus won't be called... Juergen |
Mike Zupper opened SPR-794 and commented
Here is the scenerio:
Within MyAccountForm I override the following method:
protected ModelAndView onSubmit(HttpServletRequest request,
HttpServletResponse response,
Object command,
BindException errors)
throws Exception
with proper validation and no errors, The framework should call the "onSubmit" method with the defined signature but it does not. If I override, the following method:
protected ModelAndView onSubmit(Object command)
throws Exception
it calls the "onSubmit" method properly.
I need to access the HTTP request to set session data.
I used my IDE's debugger to trace it down and I could not find any reason why that above onSubmit method does not work... Any Ideas????
Please see issue# #5420 for similar problem.
Thanks,
Mike Zupper (mzupper@boscovs.com)
Affects: 1.1.3, 1.1.4, 1.1.5
Attachments:
Issue Links:
The text was updated successfully, but these errors were encountered: