I am trying to use the encodeURL
method in a jsp to encode a URL with \"%\" symbol.
response.encodeURL(/page1/page2/view.jsp?name=Population of 91% in
In your example, you can use the c:url
and c:param
tags:
In particular, the c:param
tag will url-encode the value attribute. I just ran into a situation where I needed to generate a URL with a querystring containing a value that started with a pound sign. Without url-encoding, the pound sign was interpreted by the browser as the start of the anchor portion. I added the c:param
tag, and the pound sign was encoded, allowing expected behavior when following the link.