tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Spectron International, Inc." <spect...@caribe.net>
Subject Paths from inside the servlets
Date Wed, 28 Feb 2001 18:43:26 GMT
I have a webapp in a directory called /bin. Servlets are in
http://localhost/bin/servlet/MyServlet. Documents are in
http://localhost/bin/image.gif. What do I have to do to access the documents
from my servlets without using the hostname? For example, if I have a
servlet that has the following tag:
<IMG SRC="images/myimage.gif">
I want it to use the image in http://localhost/bin/images/myimage.gif.
Right now it will look for the image in
http://localhost/bin/servlet/images/myimage.gif.
Or if I do the following from inside the servlet:
<IMG SRC="myimage.gif">
I want it to use the image in http://localhost/bin/myimage.gif.  Right now
it will look for the image in http://localhost/bin/servlet/myimage.gif.

Is there a way to do this, or do I have to do the whole path for the image?
I want to be able to move the whole webapp just by copying the directory to
a new server. Is this even possible?

Faw




Mime
View raw message