Looks like you're basically putting your images in its own web app.  You 
may need a WEB-INF directory and trivial web.xml file under the images 
directory in order for Tomcat to like it as a web app (not sure though). 
Then, I think your url for the image would be "/images/image.gif".

Alternatively, you could move your images directory to be within your 
servlet web app.  Then, your url (from index.shtml) would be 
"images/image.gif".

HTH,
-Jeff
 




p niemandt <[EMAIL PROTECTED]>
11/18/02 09:35 AM
Please respond to "Tomcat Users List"

 
        To:     Tomcat Users List <[EMAIL PROTECTED]>
        cc: 
        Subject:        Tomcat 4 StandAlone Web Server, Static HTML and Images


Hi Group: Please help ...

I'm very new to servlets, though I do have a lot of programming
experience. My problem is that I can't seem to get images displayed
properly using Tomcat as the web server. 

I have a very simple layout ...

webapps
/servlet
                 index.shtml
                 /WEB-INF                -> My servlets and web.xml
/images
                 contains my images

I manage to serve the index.shtml quite easily, my problem is that I
can't get the images displayed without specifying the whole url in the
form file:///dir/to/images/image.gif, and I think this is wrong. 

There is a lot of information regarding how to configure a web server to
display the images, and this I can do fine, but I would like to only run
Tomcat: My site is very small, and the latency in Tomcat would not
effect it. My question is in how to specify the url for the image in the
html,

I have tried "image.gif", "/servlet/image.gif", "../image/image.gif",
"/servlet/../image/image.gif", etc, etc.

Now I suspect I'm missing something very stupid, but sadly I have no
idea what. I do not want to code the image display, as far as I know,
Tomcat should be able to handle such a simple html site. 

My servlets work well, database connectivity and all, and the site works
well if I use apache as well, but how to do this without Apache is
currently beyond me.

Any information or just hints in the correct direction would be greatly
appreciated. 


-- 
p niemandt <[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>



Reply via email to