Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

URL arguments

 
Joshi Thomas
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to pass a URL as argument to another jsp page, unfortunately the URL (argument) also contains an argument and I cannot get the value of the URL.
eg: test.jsp?url=microsoft.com/default.asp?x=5
I want the value of url to be "microsoft.com/default.asp?x=5" but when I do a request.getparameter("url"), I am getting null for the url.
Thanks in advance.
Joshi
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65537
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to encode the URL that you use as a request parameter argument so that it doesn't confuse the URL parsers.
Check out the java.net.URLEncoder and java.net.URLDecoder classes.
hth,
bear
 
You don't like waffles? Well, do you like this tiny ad?
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!