Read percent coding on Wikipedia . # and = reserved characters in URLs. Only non-reserved characters can be used equal by URL, all other characters must be URL-encoded . URL encoded value # is %23 and = is %3D . So what this should do:
code=askdfjlskdfslsjdflksfjl%23_%3D_
If this really comes from an HTML <a> link in some JSP, for example:
<a href="servletUrl?code=askdfjlskdfslsjdflksfjl#_=_">some link</a>
then you really had to change it to use JSTL <c:url>
<c:url var="servletUrlWithParam" value="servletUrl"> <c:param name="code" value="askdfjlskdfslsjdflksfjl#_=_" /> </c:url> <a href="${servletUrlWithParam}">some link</a>
so that it is generated as
<a href="servletUrl?code=askdfjlskdfslsjdflksfjl%23_%3D_">some link</a>
Please note that this does not apply to Java / Servlets per se, this applies to all web applications.
source share