It is "" not "/" for root context

-----Original Message-----
From: Archana Mathur [mailto:[EMAIL PROTECTED] 
Sent: 20 October 2005 16:03
To: <Tomcat Users List
Subject: Accessing resource from another context.. ..


Hi,
I have got a jsp page a.jsp within tomcat 5.5.9 application (say app1). I
need to access some other page a2  which is at different location ( at root
context) within a.jsp.
Example - http://localhost/app1/a.jsp - (a.jsp  wants access to other jsp
which is at location (http://localhost/a2.jsp) - root context
 
tag jsp:include  will only pick up pages from current context (app1)
 
I added had some code in my jsp page  to make it working -
ServletContext ctx = pageContext.getServletContext().getContext("/");
String myUrl = "/a2.jsp"; 
 RequestDispatcher dispatcher = ctx.getRequestDispatcher(myUrl); 
 dispatcher.include(request, response);
Somehow getContext("/") returns me null. After reading getContext method ,it
mentions - " In security conscious environments, the servlet engine can
return null for a given URL."  What do I need to do so that this
getContext("/") doen't return null value. 
 
Please help..
 
Archana
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to