0

I have the following url and i am not able to retrieve the url parameters,

https://server_ip:port/osp/elastic.jsp#access_token=eH8AILdhJNl%40X4GyzD7dpS%40ddOx%InF/CjNyztaVDxI%40/gw4qxcnf27b98dN3eTxyZ%40cVhIc/J%40J8gPiK9CAs4~&token_type=Bearer&expires_in=120

The jsp code is given below. and it returns null values.

<%
String token=(String)request.getParameter("access_token");

String type=(String)request.getParameter("token_type");

out.print("token = "+token);
out.print("\n");
out.print("type = "+type);
%>
Radha
  • 61
  • 1
  • 10
  • Don't you need to replace `#` with `?` `elastic.jsp?access_token ` – Ori Marko Apr 11 '19 at 05:15
  • Ideally, you should not use Scriplets to get the access token values, and @user7294900 comment is right. To get the values you should use `?`. To better understand use of `#`, kindly refer https://stackoverflow.com/questions/8192742/what-is-the-meaning-of-in-url-and-how-can-i-use-that. – darshgohel Apr 11 '19 at 05:29
  • I know it works with ?, but how do i get parameters by keeping # itself – Radha Apr 11 '19 at 05:30
  • How would you get parameters in javascript in case of # – Radha Apr 11 '19 at 08:31

0 Answers0