Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

URGENT! DeadLine today!  RSS feed

 
Hrithik Roshan
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i pass parameters through
<A href="rr_JobDetailsServlet?jobId=<%= jobId %>&agencyName=<%= agencyName %>&title=<%= title %>" ><%= jobTitle %></A>
when i click on the link
with
jobId = 62;
agencyName = "PATHWAY, INC.";
title = "foo";
works in IE
http://localhost:8080/project/servlet/rr_JobDetailsServlet?jobId=62&agencyName=PATHWAY,%20INC.&title=foo
fails in Netscape = 4.76
http://localhost:8080/project/servlet/rr_JobDetailsServlet?jobId=66&agencyName=PATHWAY, INC.&title=foo
because after PATHWAY,
IE adds %20
and Netscape doesn't
please i want to get it work on netscape
HELP!!!
urgent
 
Kenneth Reising
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try URLEncoding the variables, really something you should do whenever you do something like this anyway, to avoid the exact problem you are having.
Something like this should work:


HTH;
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whoops, be careful with those two methods.

static String java.net.URLEncoder.encode(String s) is what changes spaces to %20

HttpServletResponse.encodeURL(String in) will perform URL re-writing. Which , by the way, you should ALSO do. And, if you use this method, you should encode the *entire* URL.


But another way to fix this (well, it would involve a bit more... but why not use agency id, instead of agency name? But this is maybe stepping into the 'data domain'. Whatever.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!