How do I get the URL fragment identifier from HttpServletRequest?
The javadocs doesn’t seem to mention it.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can’t get the URL fragment in the way you’d like.
Typically, the browser doesn’t send the fragment to the server. This can be verified by using a network protocol analyser like tcpdump, Ethereal, Wireshark, Charles.
However, you can send the fragment string as a GET/POST parameter on a JavaScript request. To get the value using JavaScript, use
window.location.hash. You can then pass this value as a GET or POST parameter in an AJAX request, and use the getParameter methods on the HttpServletRequest for the AJAX request.Here’s what RFC3986: Uniform Resource Identifier (URI): Generic Syntax has to say: