• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
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?
Thanks,
 
I brought this back from the farm where they grow the tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic