Announcement Announcement Module
Collapse
No announcement yet.
SimpleFormController successView forward to SimpleFormContro Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SimpleFormController successView forward to SimpleFormContro

    Hi all,

    I have created a new Spring/Hibernate application which heavily depends on the SimpleFormController. I am using the dual mode feature which on HTTP GET returns a JSP and itís related command object loaded via the formBackingObject method. And on HTTP POST calls the OnSubmit method.

    Everything is working as expected, except when I set the successView of one controller to another Controller. I was hoping the forward would act as a HTTP GET, loading the command object via the formBackingObject and returning the JSP (as described in the first step above). No such luck, the only thing I have found is using a redirect. But thatís not a great solution.

    I did try to use forward (forward:controller) but found forward, like HTTP post calls OnSubmit.

    If anyone can let me know what I am doing wrong or suggest an alternative I would greatly appreciate it .

  • #2
    You can customize how the controller distinguishes a first request from a submit, by overriding isFormSubmissison(). The default is whether the request is GET or POST, but you can change this e.g. to test for the existence or value of a specific request parameter.

    HTH

    Comment


    • #3
      successView internal forward bypasses the Controller

      Thank you very much for your help, unfortunately it seams an internal forward (Spring) from a successView bypasses the Controller, and loads the JSP directly. I need to be able to point a successView to a controller, so the controller can load the form followed by the JSP. I guess I need to address the issue at a higher level, maybe at the DispatcherServlet?

      Any help, is greatly appreciated.

      Comment


      • #4
        it seams an internal forward (Spring) from a successView bypasses the Controller, and loads the JSP directly.
        Not too sure what you mean here . . .

        I haven't used it myself, but I understand a successView of e.g. "forward:myaction.do" will cause Spring to do an internal forward to the controller that handles myaction.do.
        Of course myaction.do must be a url that resolves to a controller, not a view.

        HTH

        Comment

        Working...
        X