2

Here is the URL and I wanted to read the value post hash. I did't find a direct way to get the hash value so looking for a indirect way, If I could read the full URL with hash somehow, I can easily parse.

http://localhost:8080/igcallback#access_token=<token>

What I Tried

String access_token = request.getRequestURL()

http://localhost:8080/igcallback

String request_param= request.getParameter("access_token");

null

String header_names = request.getHeaderNames()

[]
lambodar
  • 3,495
  • 5
  • 34
  • 58
  • check this http://stackoverflow.com/questions/43470421/pathvariable-in-springboot-with-slashes-in-url/43471437#43471437 – pvpkiran Apr 20 '17 at 13:28
  • 1
    That was my question. I have tested this situation with # - all after hash is ignored. – Kirill Ch Apr 20 '17 at 13:34
  • did it happen for you to get a solution finally? though it's pretty easy to handle this in JavaScript side. – lambodar Apr 20 '17 at 13:36
  • Now I don't know the solution. However I don't need this for my case. I set some simple rules for my users so that I can handle their input well. – Kirill Ch Apr 20 '17 at 13:38
  • But If you have Javascript web-client can you get necessary information from URL by JS and only then call your server with proper params? – Kirill Ch Apr 20 '17 at 13:42
  • It's web service and don't have java script, fully server side. I said it would be straight forward in javascript but not in java – lambodar Apr 20 '17 at 13:43

1 Answers1

1

The fragment hash is not sent to the server in most cases, so you can't really.

See this answer for reference:

https://stackoverflow.com/a/13503246/685876

Community
  • 1
  • 1
BobRob
  • 333
  • 2
  • 12