Hi,
I use a SimpleFormController working properly when I use POST Method. However when I use HTTP GET method it crashes reporting this error message:
javax.servlet.ServletException: Error in ModelAndView object or View resolution encountered by servlet with name 'connector': View to render cannot be null with ModelAndView [ModelAndView: materialized View is [null]; model=[{conn=es.auna.redim.beans.ActionBean@c7539, org.springframework.validation.BindException.conn=org.springframework.validation.BindException: BindException: 0 errors}]]
Why???? Should I configure anything?
Thanks a lot
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The default implementation of AbstractFormController's isFormSubmission method assumes a form submission in case of POST as method, preparing a new view else.
If you want to submit a GET request, you need to override isFormSubmission yourself and check for something else, like a specific request parameter (hidden field in your HTMl form).
The form controller must be able to properly discriminate between a request that is supposed to show a new form (initial request for the form) and a request that submits the form (user having entered data into the form).
Juergen
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2004-07-14
That's very usefull! Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I use a SimpleFormController working properly when I use POST Method. However when I use HTTP GET method it crashes reporting this error message:
javax.servlet.ServletException: Error in ModelAndView object or View resolution encountered by servlet with name 'connector': View to render cannot be null with ModelAndView [ModelAndView: materialized View is [null]; model=[{conn=es.auna.redim.beans.ActionBean@c7539, org.springframework.validation.BindException.conn=org.springframework.validation.BindException: BindException: 0 errors}]]
Why???? Should I configure anything?
Thanks a lot
The default implementation of AbstractFormController's isFormSubmission method assumes a form submission in case of POST as method, preparing a new view else.
If you want to submit a GET request, you need to override isFormSubmission yourself and check for something else, like a specific request parameter (hidden field in your HTMl form).
The form controller must be able to properly discriminate between a request that is supposed to show a new form (initial request for the form) and a request that submits the form (user having entered data into the form).
Juergen
That's very usefull! Thanks