File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes calling index.jsp from servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "calling index.jsp from servlet" Watch "calling index.jsp from servlet" New topic

calling index.jsp from servlet

nikil shar
Ranch Hand

Joined: May 25, 2008
Posts: 116
hi all,
i have a index.jsp in my WEB-INF directory. how do i call/load this jsp from a servlet ?? have tried the below but the application doesnt seem to be able to find the jsp.

servlet :

so there is a "home" button which is meant to take the user back to the index.jsp page.

thanks in advance.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63838

You cannot directly address any resource under WEB-INF.

Frequently, all JSPs are placed under WEB-INF so that they cannot be addressed without going through their controllers. If your index.jsp does not have a controller, it cannot be placed under WEB-INF.

Please read this article for information on modern web application structure.

[Asking smart questions] [About Bear] [Books by Bear]
Amol Nayak
Ranch Hand

Joined: Oct 26, 2006
Posts: 218
You may include of forward request to this page from another web component which is directly accessible to the client.
I agree. Here's the link:
subject: calling index.jsp from servlet
It's not a secret anymore!