Hi,
I have the following problem:
I have a servlet which is called com.MyCompany.MyProject.MyServlet
(MyServlet is the actual class name). I am usign JSDK 2.1 and the Servlet
Runner. My servlet generates some HTML with GIFs.
The directory structure looks like this:
webpages // from JSDK
GIF // I created
MyGif.gif
Web-inf // from JSDK
servlets // from JSDK
com
MyCompany
MyProject
MyServlet.class
The only way I could get the GIF to show up correctly, was by calling
getServletContext().getRealPath("/GIF/MyGif.gif"). getRealPath() indeed
returned the correct absolute path and everything worked fine. However, it
only worked from my computer, not from others.
I then tried to do some kind of a relative path thing, but anything I tried
did not work. I think I tried "GIF/MyGif.gif", "../GIF/MyGif.gif", etc.
I guess, the question would be, where would it be relative from in this
situation?
Any ideas?
George Svedloff
___________________________________________________________________________
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