Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

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,
reply
    Bookmark Topic Watch Topic
  • New Topic