Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to define file paths in Tomcat 3.1

 
Travis Gibson
Ranch Hand
Posts: 100
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Madhav Lakkapragada
Ranch Hand
Posts: 5040
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic