Koustubh,
You need to use the getContext() method of javax.ServletContext instead of
getRequestDispatcher()
getContext
public ServletContext getContext(java.lang.String uripath)
Returns a ServletContext object that corresponds to a specified URL on
the server.
This method allows servlets to gain access to the context for various
parts of the server, and as needed obtain RequestDispatcher objects from
the context. The given path must be absolute (beginning with "/") and is
interpreted based on the server's document root.
In a security conscious environment, the servlet container may return
null for a given URL.
Parameters:
uripath - a String specifying the absolute URL of a resource on the
serverReturns:
the ServletContext object that corresponds to the named URLSee Also:
RequestDispatcher


-Richard


At 10:54 AM 9/7/01 -0400, you wrote:
>  Hello,
>  I have a problem with the requestdispatcher.
>
>  Under webapps ---> I have onefolder called test1
> -->webapps-->classes-->servlet1.java
>  Another folder is test2 -->webapps-->classes-->mypage.jsp
>
>  I need to do a getRequestDispatcher(path).forward(req,res) in the
> servlet1.java. I have to dispatch a request to the mypage.jsp in the
> test2 folder. I tried various combinations but fails to respond correctly
> using both ServletRequest and ServletContext. Can I go from my current
> context test1 and access another context test2 and therefore the jsp page
> ? If so how ??
>
>  Thanks,
>  - Koustubh
>
>
>
>
>
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
>===========================================================================
>To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
>JSP-INTEREST".
>For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
>Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to