This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
Hi! This is the problem I face some times when using get method to pass values from one page to other.If the values im trying to pass has some ampersands(&) (e.g) say <a href="http://localhost/file2.jsp?value=aa<b rel="nofollow">&&&&&</b>aaa" target="_blank">http://localhost/file2.jsp?value=aa&&&&&aaa purposely I have added some ampersands for value and im sure this will end up in problem Is there any way to overcome this???
Of course it is possible, and simply making it a string will do nothing for you. All your URL values should be URL-encoded. You can easily accomplish this with the help of the java.net.URLEncoder class. This will encode special characters (such as the &) to a form that will not confuse the format of the URL. [ April 01, 2004: Message edited by: Bear Bibeault ]