Results 1 to 4 of 4

Thread: SimpleFormController successView forward to SimpleFormContro

  1. #1
    Join Date
    Apr 2005
    Posts
    2

    Default 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. #2
    Join Date
    Aug 2004
    Location
    Carlisle, UK
    Posts
    184

    Default

    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
    Chris Harris
    Carlisle, UK

  3. #3
    Join Date
    Apr 2005
    Posts
    2

    Default 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.

  4. #4
    Join Date
    Aug 2004
    Location
    Carlisle, UK
    Posts
    184

    Default

    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
    Chris Harris
    Carlisle, UK

Similar Threads

  1. Replies: 1
    Last Post: Oct 21st, 2005, 05:27 AM
  2. SimpleFormController not do onSubmit
    By heleno_alves in forum Web
    Replies: 2
    Last Post: Oct 18th, 2005, 07:22 AM
  3. Replies: 3
    Last Post: Sep 22nd, 2005, 10:14 AM
  4. The forward: feature
    By eisenb in forum Web
    Replies: 0
    Last Post: Dec 13th, 2004, 03:57 PM
  5. Servlet & portlet packages (SimpleFormController)
    By mpetrashev in forum Architecture
    Replies: 0
    Last Post: Dec 2nd, 2004, 10:11 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •