File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Calling JSP with in WEB-INF Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Calling JSP with in WEB-INF" Watch "Calling JSP with in WEB-INF" New topic

Calling JSP with in WEB-INF

Parameswaran Thangavel
Ranch Hand

Joined: Mar 01, 2005
Posts: 485
hi all,
My requirement:

i need to show a particular jsp page as a pop-up.

Both the source and destination jsp pages are inside web-inf, say temp.jsp and popup.jsp. On Clikcing the link in temp.jsp, popup.jsp is shown in a pop-up window. for which i am using the following in temp.jsp

<c:url var="thisURL" value="WEB-INF/jsp/popup.jsp">
<c:param name="index" value="${statusCode.index}"/>

And i am using the above url value in function which is called from the href link.

The problem is the server is responding with the error code 404. so i doubt the way URL is coded.

so any idea where and whats the problem.
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Per the servlet spec, browsers can not see WEB-INF or any files under it.
If you want to store your JSP there, you will need to create a controller which forwards to it.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Travis Hein
Ranch Hand

Joined: Jun 06, 2006
Posts: 161
I guess at the very minimum you could create a jsp page outside of the WEB-INF that just does an include your one in the WEB-INF.
That way, it can stay inside the WEB-INF for other places that want to use it there.

so make a new /popup.jsp

well, the param is probably not needed, but is there for clarity.

then your link invocation would be

Error: Keyboard not attached. Press F1 to continue.
I agree. Here's the link:
subject: Calling JSP with in WEB-INF
It's not a secret anymore!