If you edit conf/context.xml and add crossContext="true", one Tomcat
mounted web-app should be able to forward to (or include content from)
another in the same request.

I can't get it working and I have a minimal Github project (
https://github.com/paul-hammant/servletDispatcherTest) that shows how far I
got. It has 'a' and 'b' as web-apps (war files) and simple five line
servlets showing the code, attempting to use

        // in 'a' webapp servlet filter ...
        ServletContext context =
httpsr.getSession().getServletContext().getContext("/b");
        RequestDispatcher requestDispatcher =
context.getRequestDispatcher("/anything");
        requestDispatcher.include(request, response);
        // gives .. The requested resource (/b/anything) is not available
// If it were not for crossContext="true", there would be a n NPE.

I'm looking for a whole example of this working. I mean a downloadable and
buildable zip of a project somewhere on the web. Obviously I've tried
google searching for that. I've also looked in Tomcat's source and can't
see and example or integration test for crossContext :-(

- Paul

Reply via email to