Gregory Guthrie wrote:

> If I generate href's  with relative URL's in a returned page from a
> servlet, what is the Base URL it has?
>

Unless you override it (with a meta tag in the <head> section, I think) the
base URL of a page generated by a servlet is the URL of that servlet.

Let's look at an example.  Assume you have a web application at
"http://www.mycompany.com:8080/myapp", and you have an "images" directory
underneath the document root containing your images.  Now, assume you have a
servlet whose URL is:

    http://www.mycompany.com:8080/myapp/servlet/MyServlet

If you want the page generated by this servlet to refer to an image in the
images subdirectory, you will need to generate your <img> tag like this:

    <img src="../images/myimage.gif">

in order to resolve the relative URL correctly.

>
> Thanks,
> Gregory Guthrie
>

Craig McClanahan

___________________________________________________________________________
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