[jboss-user] [Tomcat, HTTPD, Servlets & JSP] - Foreign Context

nsakiya do-not-reply at jboss.com
Thu Aug 23 15:42:34 EDT 2007


Hi all,
I am trying to get a context across web apps so that I can include JSP page in another web app as follows:

ServletConext ctx1 = config.getServletContext();
ServletConext ctx2 = ctx1.getServletContext("/aa/bb");
RequestDispatcher rd = ctx2.getRequestDispatcher("/cc");
rd.include(request, response);

However, the first web context I have is "/aa" and the second one  is "/aa/bb."  At runtime, it doesn't seem to resolve "/aa/bb" correctly.  Instead, it gave me the same reference as ctx1.  This code runs fine if the second context doesn't start with "/aa".  I guess somehow app server thought "aa/bb" is a part of "aa".

 Am I violating any Servlet spec or missing something here?  What is the right way to do it without changing the context names.  Any workaround?  I run this JBoss 4, by the way.

Thanks a lot!

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4077508#4077508

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4077508



More information about the jboss-user mailing list