• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting URL's from the server for use in the sevlet.

 
William Wild
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
How can you retreive the context URL (in the form http://xx ort/yy/) from within the servlet?
I need to be able to use it as the start of the xsl-t stylesheet url to embed in my xml data. Unfortunatly, all I have found are methods with in ServletContext, but they do not return the http:// section, only the paths from the context root or system paths.
Does anyone know of a method that I can use to get the full url path??
Kind regards
Simon
 
William Wild
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I will answer my own question here, incase anyone else has the same problem. With much calling of every method I could find I came up with this solution.
If the call from the client is in post form then this should work.

If anyone knows of an other solution that may be a bit more portable I would be greatful.
Cheers
Bill
 
preveeth ott
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
try
HttpUtils.getRequestURL(request)
followed by some string manipulating, u should be able to get the result
chow chow
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic