views:

36

answers:

2

I am using java ee and request.getQueryString() doesnt return the #hashpart

my/page?id=4#hash

I am using Struts 2

Is there any solution?

+2  A: 

Not really. In many cases the hash tag isn't sent to the server by your client's browser.

For example, requesting this url:

http://stackoverflow.com/questions/2923610/java-getquerystring/2923618#2923618

Sends a request with these headers to the server:

GET /questions/2923610/java-getquerystring/2923618 HTTP/1.1
Host: stackoverflow.com
Kobi
+2  A: 

The hash part of the url is (in principle) useful only to the client side, so normally the browser does not send that portion to the server. Are you sure you are interested in reading it, in the server side? Normally, you shoudn't.

For special needs, you can read here http://stackoverflow.com/questions/317760/how-to-get-url-hash-from-server-side

leonbloy