2

I am using Java EE and request.getQueryString() doesn't return the #hash part

my/page?id=4#hash

I am using Struts 2.

Is there any solution?

2

2 Answers 2

3

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 How to get Url Hash (#) from server side

Sign up to request clarification or add additional context in comments.

1 Comment

access to the hash would be great - jwt tokean after auth provided as a hash in url.
3

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

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.