spring mvc simpleformcontroller - how to stop execution when exception thrown
Posted
by alan t
on Stack Overflow
See other posts from Stack Overflow
or by alan t
Published on 2010-05-24T03:11:44Z
Indexed on
2010/05/24
3:21 UTC
Read the original article
Hit count: 409
Hi
I am using simpleformcontroller and get exception thrown in my OnSubmit method. This does not seem to stop the simpleformcontroler process as it redisplays my form.
I can see from log4j output that the exception is getting caught and forwarding to my error page as expected. I can also tell the onSubmit method does not continue after the exception. Which is all good.
But i do not see the error page as the simpleformcontroller starts up again and goes through processing for a new form (i can see in log4j ouput Spring log statements 'Displaying New form', 'Creating new command of class ..'. The normal form page is then displayed again.
So the problem is that the exception does not seem to terminate the SimpleFormController, it carries on to display the form again.
Anyone help? Thanks Alan
© Stack Overflow or respective owner