• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

request.getRequestURI() problem

 
chandramohan sampath
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I am using request.getRequestURI() to get the url of the calling page.
But, Can anyone let me know how do i get the complete url.
eg: if http://localhost:8080/servlet/abc.jsp?abc=12324&xyz=5830 is the url of the page.
when i use request.getRequestURI() I get only http://localhost:8080/servlet/abc.jsp.
But, I need to get the values of abc and yxz parameter also.
Can anyone let me know about it.
thanks a lot
chandru
 
Simon Brown
sharp shooter, and author
Ranch Hand
Posts: 1913
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Chandru,
You can get the entire URL back by concatenating the following items :
(1) the url, accessed by request.getRequestURL()
(2) followed by a question mark character (?)
(3) and finally the query string, accessed by request.getQueryString()
If it's just the values of abc and xyz you need, these can be accessed by using the getParameter() method. For example :
request.getParameter("abc");
request.getParameter("xyz");
Hope that helps..
Simon
------------------
Simon Brown
Co-author of Professional JSP 2nd Edition
[This message has been edited by Simon Brown (edited August 23, 2001).]
 
chandramohan sampath
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi simon,
Thanks a lot.
It's working for me.
regards
chandru
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic