question
0
Votes
Votes
3
Answers
Answers
M$0.00
JSP with hard coded URL String containing ? character ends up as %3F and breaks link. AIX Only. Ideas?
The asker of this question selected no best answer.
answers (3)
Can you provide some of the code?
Check the documentation to see if you can turn off URL escaping. Or is if there an API that allows you to construct a URL from components.
Try replacing the ? in the hard coded url with %3F.
Or, if your URL look like this http://www.domain.com/blah.jsp?query=test (with the only ? coming after blah.jsp)
then link is correct and there is something wrong with your software. The ? is a reserved character that indicates that parameter values follow.
Or, if your URL look like this http://www.domain.com/blah.jsp?query=test (with the only ? coming after blah.jsp)
then link is correct and there is something wrong with your software. The ? is a reserved character that indicates that parameter values follow.
Related questions
140 characters left













myURL = serverPrefix+"arg?"+someArg;
That URL, when launching in the browser (though the mouseover looks fine) will actually open with %3F for the "?" character - result is a bad link.
Before you print out the variable myURL, have you tried running it through URLDecode? Try taking a look at java.net.URLDecoder - http://java.sun.com/j2se/1.4.2/docs/api/java/net/URLDecoder.html
The expression would be "java.net.URLDecoder.decode(myURL)" to decode the string.
Also just in case can you tell us what browser you are using?
Also if you could provide just a little more code specifically to provide more details related to the way in which myURL becomes part of the rendered page that may help.
@ilaksh This occurs on all browsers but only on AIX servers. Other systems do not exhibit this particular problem.
Also one thought is, what if this isn't actually related to the ? mark but its some other text that is the problem.. maybe one server is case sensitive and another is not.
@ilaksh There isn't actually an HREF - this is a URL stored in a DB and being grabbed out later. Once again entirely environmental to AIX.
I'm thinking this is something I am going to have to investigate outside of Java - such as the DB encoding.
Whatever the problem is causing this "%3F" replace, you should be able to do a string replace right before you print the variable.
I wish I could help more, but my knowledge of AIX servers is limited.