views:

324

answers:

1

URL can have a label, separated with a "#" sign, coming after the URL parameters. E.g. http://example.com/foo/bar.jsp?p1=v1#test_label

I would expect label to be part of request.getQueryString() and part of request.getRequestURL().toString(). But it doesn't seem to be there.

Is there a way to retrieve the label value from HttpServletRequest on server side?

+11  A: 

I think the HTTP spec decided that "anchors" (Is that what they're called? Anyway, the hash sign and the label that comes after) don't get passed to the server, they're just used client-side to scroll the page, or to be used in JavaScript. So there's no way you can get that value, other than having a little script passing it to your server with an Ajax request once the page is loaded, but that's not very convenient.

Etienne Perot
+1: Anchors are strictly client-side.
Andrew Medico
gratz on enlightened.
antony.trupe
Yipee~ :D Thanks
Etienne Perot