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

Servlet basics

 
Amruth Puppala
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to encode the URL.

resopose.encodeURL() does URL rewriting , but how can we do the URL encoding.
 
Ghufran Ul Haq
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try java.net.URLEncoder.encode()
 
Amruth Puppala
Ranch Hand
Posts: 295
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the response.

yeah java.net.URLEncoder.encode() does encoding correct.
In JSTL we have very good mecanism for encoding url
Example
<c:url value=�/inputComments.jsp� var=�inputURL� >
<c aram name=�firstName� value=�${first}� />
<c aram name=�lastName� value=�${last}� />
</c:url>

Same way don't we have any method in servlet api which does this purpose?
[ August 01, 2008: Message edited by: Chintu sirivennela ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic