There is no method that directly returns the URL requested by the client.
I thought getRequestURL would be what you wanted but this should work... I'm
pretty sure that getRequestURL is basically just doing the following anyhow,
so maybe there are issues that Russell Gold mentioned.

// builds client requested URL
String requrl = req.getScheme() + "://" + req.getServerName() +
                    ":" + req.getServerPort() + req.getRequestURI();

hope this helps

john haro
AGENCY.COM


-----Original Message-----
From: A mailing list for discussion about Sun Microsystem's Java Servlet
API Technology. [mailto:[EMAIL PROTECTED]]On Behalf Of
Russell Gold
Sent: Friday, August 04, 2000 6:37 AM
To: [EMAIL PROTECTED]
Subject: Re: Request Url in a servlet


At 3:53 AM -0400 8/4/00, Carine Porret wrote:
>Hello,
>
>I'm trying to get the url string using HttpUtils getRequestUrl
(HttpServletRequest req) but it returns only part of the string I need.
>The idea is for me to get the first part of the url where the name of the
server and the domain is, and that method shortcuts the name of the domain.
>
>Would anybody know a method to get the entire url ?

HttpUtils.getRequestURL returns the entire URL from the viewpoint of the
server. Make sure that the server itself knows what domain it is in; that
works differently from OS to OS

------------------------------------------------------------------------
Russell Gold                     | "... society is tradition and order
[EMAIL PROTECTED]    (preferred)  | and reverence, not a series of cheap
[EMAIL PROTECTED]              | bargains between selfish interests."
[EMAIL PROTECTED]       |   - Poul Anderson, "Iron"

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to