Announcement Announcement Module
Collapse
No announcement yet.
Form Controllers - navigating to a new view Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Form Controllers - navigating to a new view

    When a form controller (either SimpleFormController or a custom subclass of AbstractFormController) processes a form submission successfully and needs to navigate to a different view, how is initialisation for the new view best performed?

    The new view would typically have its own controller for handling new form requests, initialising reference data, processing submissions, etc.

    Ideally the first controller would somehow invoke the "new form" workflow documented in AbstractFormControler for the second form (to initialise reference data, etc) before rendering the view.

    How is this normally done? (I don't think AbstractWizardFormController is relevant here as I'm not necessarily dealing with a sequence of actions that has a defined start and finish.)

    Thanks in advance ...

    Steve

  • #2
    Check out the javadocs of UrlBasedViewResolver:
    Code:
     * <p>As a special feature, redirect URLs can be specified via the "redirect&#58;"
     * prefix. E.g.&#58; "redirect&#58;myAction.do" will trigger a redirect to the given
     * URL, rather than resolution as standard view name. This is typically used
     * for redirecting to a controller URL after finishing a form workflow.
     *
     * <p>Furthermore, forward URLs can be specified via the "forward&#58;" prefix. E.g.&#58;
     * "forward&#58;myAction.do" will trigger a forward to the given URL, rather than
     * resolution as standard view name. This is typically used for controller URLs;
     * it is not supposed to be used for JSP URLs - use logical view names there.
    or take a look at the springworkflow system (http://dev.competities.com) that handles redirecting and forwarding and defining the possible workflows in a central xml file and handles the navigation programming for the flows.

    Gr
    Ronald

    Comment

    Working...
    X