Results 1 to 5 of 5

Thread: Controller to Controller

  1. #1
    Join Date
    Oct 2005
    Posts
    10

    Default Controller to Controller

    Hi
    Can anybody here help me forwarding a request in one controlloer to another controller?

    cheers
    Prins

  2. #2

    Default

    You can call the handleRequest method on any controller:

    Code:
    public class ... extends AbstractController {
        private Controller someController = null;
    
        public void setSomeController(Controller ctrl) {
            this.someController = ctrl;
        }
    
        protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response) throws Exception {
            return this.someController.handleRequest(request, response);
        }
    }
    There may be conflicts when setting different caching semantics in these two controllers although that is probably unusual in most applications.

  3. #3
    Join Date
    Oct 2005
    Posts
    10

    Default

    Ok, not 100% sure of this, but may aim is to do: when i am preparing to show a formView (ControllerPage1.jsp) (as a property of Controller1) and i it doesnt fulfill the conditions and thus i want to pass it to Controller2 and let Controller2 show its formView(ControllerPage2.jsp).
    Dont know if you know what im meaning

    cheers
    Prins

  4. #4
    Join Date
    Jul 2005
    Posts
    246

    Default

    Quote Originally Posted by prinsinn
    Ok, not 100% sure of this, but may aim is to do: when i am preparing to show a formView (ControllerPage1.jsp) (as a property of Controller1) and i it doesnt fulfill the conditions and thus i want to pass it to Controller2 and let Controller2 show its formView(ControllerPage2.jsp).
    Dont know if you know what im meaning

    cheers
    Prins
    You need an org.springframework.web.servlet.view.InternalResou rceView

    Bob

  5. #5
    Join Date
    Oct 2005
    Posts
    10

    Default

    Ok, now we are getting somewhere devijvers, now im able to redirect from controller1 to controller2, display controller2īs view, but when i submit in controller2 i get the request/onsubmit action into controller1!
    Any clue?

    cheers
    Prins

Posting Permissions

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