aspose file tools*
The moose likes Servlets and the fly likes How to define file paths in Tomcat 3.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to define file paths in Tomcat 3.1" Watch "How to define file paths in Tomcat 3.1" New topic
Author

How to define file paths in Tomcat 3.1

Travis Gibson
Ranch Hand

Joined: Oct 17, 2000
Posts: 100
Howdy fellow ranchers,
The question I have relates to including GIFs inside of JSPs. When I am testing the JSPs using localhost:8080 the GIFs are found and displayed just fine.
But when I attempt to use my JSPs from outside my localhost the JSPs still work but the GIFs are missing.
I setup an image directory in directory which contains the JSP. and used "/image/test.gif" but JSPs still cannot locate the gif.
It displays the gifs just fine if I define the entire path (i.e. C:\jsp\images\test.gif) but I don't like the idea of having hardcoded paths in my JSP code

Any suggestions..??

------------------
Regards,
Travis M. Gibson, SCJP
Java Developer
www.travismgibson.com
travis@travismgibson.com


Regards,<BR>Travis M. Gibson, SCJP<BR>Java Developer<BR>www.travismgibson.com<BR>travis@travismgibson.com
Madhav Lakkapragada
Ranch Hand

Joined: Jun 03, 2000
Posts: 5040

generally I have seen that the images can be displayed when
you use image/test.gif. I don't think you should use /image/test.gif. However, you shouldn't put them under WEB-INF
though!
So the dir structure would be:


My two cents.
regds.
- satya

Take a Minute, Donate an Hour, Change a Life
http://www.ashanet.org/workanhour/2006/?r=Javaranch_ML&a=81
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to define file paths in Tomcat 3.1