Menu

Submit using HTTP GET Method

Anonymous
2004-07-09
2004-07-14
  • Anonymous

    Anonymous - 2004-07-09

    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

     
    • Juergen Hoeller

      Juergen Hoeller - 2004-07-09

      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

       
    • Anonymous

      Anonymous - 2004-07-14

      That's very usefull! Thanks

       

Log in to post a comment.

MongoDB Logo MongoDB