• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to access jsps in a different pathinfo path in the same webapp using c:url  RSS feed

Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
c:url jstl tag lets you use absolute/ relative urls. We can also use a separate web-app context by specifying the context parameter. But if my current jsp url is http://www.mysite.com/myApp/myServlet/myDir1/someName1.jsp and I want to use c:url to get to http://www.mysite.com/myApp/myServlet/myDir2/someName2.jsp, how do I do it?

<c:url value="someName2.jsp"/> will take me to http://www.mysite.com/myApp/myServlet/myDir1/someName2.jsp (notice the myDir1) and
<c:url value="/myDir2/someName2.jsp"/> will take me to
http://www.mysite.com/myApp/myDir2/someName2.jsp (notice the missing servlet name)

Does any one know how to accomplish this?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!