Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jstl tags for url rewriting

 
Shruthi Karthick
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what are jstl tags used for URL rewriting?
 
Nitin Vashishtha
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<c:url>

example to use:
<a href="<c:url value='/test.jsp'/>">Click Here</a>
 
Nitin Vashishtha
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<c:url> can also be nested with <c aram> if you want to send some parameters to the redirected resource
example:
<c:url value="/test.jsp">
<c aram name="today" value="04/06/2008"/>
</c:url>

It performs url encoding as well.
 
Shruthi Karthick
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i hav read in spec that for c:redirect same rewriting rules are applicable as of c:url..
does it mean c:redirect also does the functionality of URL rewriting for redirect request?
 
Nitin Vashishtha
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No.
This action is used to send an HTTP redirect response to a user's browser, and is the JSTL equivalent of the sendRedirect() method of javax.servlet.http.HttpServletResponse only,it does not perform the functionality of URL Rewriting.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic