I want to know how to get full request url I need #test=1234 but using HttpServletRequest request.getRequestURI() or request.getRequestURL().toString() return path only, like https://stackoverflow.com/myquestion Help me
Asked
Active
Viewed 2,336 times
2 Answers
5
#test=123
is called an Anchor. And Anchors are not submitted to the server, they only reside in the Broswer
@see:
0
Anchors or URL fragments are not sent by the client to the server when requesting for a resource. The anchor's or fragment's are utilized to identify a location within a resource and not a different resource on the server.
Fragment URL is not part of the URL. You can get the anchor using javascript & save them in cookies to retain them.
var anchor = window.location.hash;

Jeevan Patil
- 6,029
- 3
- 33
- 50
-
Downvoter, Please let me know the reason. Read the accepted answer here & let me know what was wrong in my answer. http://stackoverflow.com/questions/6745993/how-to-get-the-anchor-name-in-http-get – Jeevan Patil Mar 29 '13 at 07:35
-
1Well I thought it was a perfectly valid answer. Back up to 0! – user2219808 Sep 29 '18 at 12:51