• Post Reply Bookmark Topic Watch Topic
  • New Topic

How do I get the whole URL?

 
John Bennet
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to get the whole URL(http://www.mysite.com/abc/def)in the servlet file, but I'm getting only(/abc/def). Can somebody tell me how I get the whole URL?
 
Yvonne Bennet
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try this:
String url = request.getRequestURL().toString();
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!