aspose file tools*
The moose likes Servlets and the fly likes get domain url Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "get domain url" Watch "get domain url" New topic
Author

get domain url

Joseph Sweet
Ranch Hand

Joined: Jan 29, 2005
Posts: 327
Does anyone know how I can get the domain url by somthing like the ServletContext.

Somthing like http://www.mydomain.com

Thanks.


We must know, we will know. -- David Hilbert
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61617
    
  67

Did you check the API for HttpServletRequest?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Joseph Sweet
Ranch Hand

Joined: Jan 29, 2005
Posts: 327
Are there any methods to get only the protocol + domain part from the string returned by HttpServletRequest.getRequestURL()

?
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

http://java.sun.com/j2ee/1.4/docs/api/javax/servlet/http/HttpServletRequest.html


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: get domain url