Status: New
Owner: ----

New issue 621 by [email protected]: ServeltContext#getRequestDispatcher cannot forward to Guice Servlets
http://code.google.com/p/google-guice/issues/detail?id=621

Here is the simplest test case (I'm using tomcat 5.5.33):

* Use Guice ServletModule to configure two servlets, one of which just dispatches to the other:

    protected void configureServlets()
    {
        serve( "/dispatcher" ).with( DispatcherServlet.class );
        serve( "/dispatchee" ).with( DispatcheeServlet.class );
    }

* Dispatchee outputs text for verification, dispatcher redirects like this:

protected void doGet( HttpServletRequest req, HttpServletResponse resp )
            throws ServletException, IOException
        {
            this.getServletContext().getRequestDispatcher( "/dispatchee" )
                .forward( req, resp );
        }

* Invoking /dispatcher yields a blank page with a 404 status that is incorrectly served up by Tomcat's default servlet.

* When configuring via traditional web.xml instead of guice, everything works as expected.

* I did some debugging and it looks like Tomcat's internal pattern matching inside its RequestDispatcher implementation isn't even aware of the servlet mapping that Guice configured.

To fix it sounds like Guice will have to wrap the RequestDispatcher object returned from ServletContext to route requests appropriately (see discussion on issue 372).

Attachments:
        GuiceRequestDispatcherBug.java  1.4 KB

--
You received this message because you are subscribed to the Google Groups 
"google-guice-dev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice-dev?hl=en.

Reply via email to