0

In my web portal, for some users (not all), when they click to a link, the '&' characters become '+'.

For example, the link is : www.mysite.com/test.jsp?param1=test1&param2=test2 ,

Then it becomes : www.mysite.com/test.jsp?param1=test1+param2=test2

It only happens for a specific country (Brazil). My other portals with same code work correctly.

I thought to handle request with servlet and when I see "+" replace with "&" but it is not a proper solution I think..

Any idea ?

earthmover
  • 4,395
  • 10
  • 43
  • 74
anL
  • 1,073
  • 1
  • 11
  • 31
  • possible duplicate of [What is a valid URL query string?](http://stackoverflow.com/questions/13373504/what-is-a-valid-url-query-string) – laune Jul 11 '14 at 10:21
  • You may have to adapt your query string parsing accordingly. The cited RFC should be consulted, but it doesn't say you must use & or cannot use +. – laune Jul 11 '14 at 10:22

1 Answers1

0

Try with JSTL core tag c:url

This tag automatically performs URL rewriting when necessary. The JSTL url tag is just an alternative method of writing the call to the response.encodeURL() method. The only real advantage the url tag provides is proper URL encoding, including any parameters specified by children param tag.

Sample code:

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<c:url value="/test.jsp" var="url">
    <c:param name="param1" value="test1" />
    <c:param name="param2" value="test2" />
</c:url>

<a href="${url }">Click Here</a>
Braj
  • 46,415
  • 5
  • 60
  • 76