java - How can I get request parameter value if value is hash symbol (#) -


i have following request url:

localhost:8080/myapp/browse/alphabetical/result?startswith=#&page=1&size=10&sort=title&order=asc 

notice request parameter "startswith=#".

i unable "#" value of 'startswith' request parameter. instead, empty string ("") value of 'startswith' request parameter. there possible way "#" value of request parameter?

this not work: ${param.startswith eq '#'}

this works: ${param.startswith eq ''}

if there no way handle this, have resort using startswith=0 ... startswith=9 instead of startswith=#, don't want

you cannot send # query string that. won't part of query string.

quoting rfc - section 3.4:

the query component indicated first question mark ("?") character , terminated number sign ("#") character or end of uri.

you need encode parameters in query string, before sending request. e.g., in jsp page, can use <c:url> jstl tag:

<c:url value="/myapp/browse/alphabetical/result" var="url">   <c:param name="startswith" value="#" />   <!-- rest of parameters --> </c:url> 

Comments

Popular posts from this blog

css - Which browser returns the correct result for getBoundingClientRect of an SVG element? -

gcc - Calling fftR4() in c from assembly -

Function that returns a formatted array in VBA -