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, How to manipulate ampersand character in JSP's. I need to use '&' char in the URL string. For ex: "../test.jsp?id=1059&title=Test for RM&DRT". Here I can get id using request.getParameter("id") and same as title. But title I am getting as 'Test for RM', I am missing '&DRT. I know '&' seperates parameters, but I need to send 'Test for RM&DRT' as whole URL string. I tried '&' char with %26 char, its working fine if I hardcode it in browser. I want to send it from a JSP page to another JSP page. Could anyone please suggest me how to solve the problem. thanks,
You need to use the UrlEncoder class to encode the parameter's value e.g. String s = "ab&d defgh"; String paramvalue = URLEncoder.encode(s); you can then pass this encoded value intact in the url and use URLDecoder.decode to decode the value. Hope this helps!
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: how to manipulate ampersand(&) char in JSP query string