Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling JSP with in WEB-INF

 
Parameswaran Thangavel
Ranch Hand
Posts: 485
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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}"/>
</c:url>

And i am using the above url value in window.open 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
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Travis Hein
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic