Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

moving in directory structure through servlet

843841Sep 22 2003 — edited Sep 24 2003
Hi everyone,

I am currently using this directory structure and have 2 web applications "myweb1" and "myweb2".

/myweb1/jsp pages
/myweb1/WEB-INF
/myweb1/WEB-INF/classes
/myweb1/WEB-INF/classes/myservlet
/myweb1/WEB-INF/lib

/myweb2/display.jsp
/myweb2/WEB-INF
/myweb2/WEB-INF/classes
/myweb2/WEB-INF/lib


I have a servlet named "myservlet" in WEB-INF/classes directory(myweb1 application) as shown above. I have following entries in my web.xml file of "myweb1" webapplication.

<servlet>
<servlet-name>myservlet</servlet-name>
<display-name>myservlet</display-name>
<servlet-class>com.abc.servlet.myservlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>myservlet</servlet-name>
<url-pattern>/myservlet</url-pattern>
</servlet-mapping>

This whole application is running fine. Now I need to forward user from "myservlet" to "display.jsp" page in myweb2 application.

I am using this line in "myservlet" file.

getServletConfig().getServletContext().getRequestDispatcher("../myweb2/display.jsp").forward(request, response);

however this line is not working. Can anyone suggest me how to access display.jsp file from myservlet.

Thanks.
Rahul



Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 22 2003
Added on Sep 22 2003
4 comments
92 views