Announcement Announcement Module
Collapse
No announcement yet.
How to forward the request from a MultiActionController Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to forward the request from a MultiActionController

    I have a MultiActionController, which has its business logic like this:
    1. Find the "UserContext" in session.
    2. If context exists, goto his preference screen
    3. else goto registration Controller (A SimpleFormController)

    Now the problem is that each mthod of the MultiActionController returns a ModelAndView, which goes to a JSP file. I need to forward the control to another controller (in case of step 3). Is there a way to do so?

    Please guide.

    Regards,
    Pankaj

  • #2
    Assuming your registration controller is mapped to a URI register.htm, you could use a RedirectView to chain your controllers:
    Code:
    return new RedirectView("register.htm");

    Comment


    • #3
      Thanks for the solution.
      This worked for me too:
      return new ModelAndView("redirect:login.htm");

      Any idea if there's a difference between the two?

      Comment


      • #4
        The URLBasedViewResolver "understands" the "redirect:/" and "forward:/" views.

        Why don't you forward to a view that maps onto a controller? Like a ForwardView or RedirectView?

        Comment

        Working...
        X