Problem reading data from servlet get request!
I have a servlet get request URL like this
http://hostname:port/servletname?UA=PC#token=123456
How to read values thats available after #tok开发者_运维问答en
?
request.getParameter(#token)
gives null..
Any help would be appreciated
Thanks, Krishnan
That's because #token
isn't a parameter, it's an HTML page anchor reference. In fact, the browser never even sends it to the server, it's kept entirely on the browser.
If you need to pass the token to the server, you need to encode it as a parameter, i.e.
http://hostname:port/servletname?UA=PC&token=123456
could you try request.getQueryString() ?
精彩评论