Tomcat Can't See Images or Javascript Subdirectories
Scott Farran
Greenhorn
Joined: Mar 10, 2002
Posts: 9
posted
0
Hello All, Thanks in advance for your help on this matter. I have installed Tomcat 4.0 and brought over a web app that is running on another Tomcat Server elsewhere no problem. My HTML and JSp's are in an application directory under the root. (as an example accessing this works fine -http://localhost:8080/NewbornNews/index.html) However the problem I am runniong into is that also in the NewbornNews directory I have two subdirectories named images and scripts. On my server the application cannot see any images or javascript functions when they are in the subdirectories. They are being accessed in very simple ways <BODY BACKGROUND="/graphics/nbnbgr1.jpg"> or <SCRIPT TYPE="text/javascript" SRC="/scripts/test.js"></SCRIPT> Did I miss something in the configuration of my server or set-up of the app or am I missing something really easy?? Do I need a config file for the application?? This same code executes no problem on the production version also running on tomcat. Thanks Again, Scott SCJP
Bear Bibeault
Author and opinionated walrus
Marshal
The leading slash in this URL tells the web server (Tomcat in this case) to look for the graphics folder at the root. If this folder is relative to the URL of the current page (this assumes you are doing any servlet mapping in the URL), omitting the leading slash should tell the server to look in the right place. hth, bear
Thanks Bear, I guess when I moved the app one directory lower than the root I needed more than one slash. I will figure it from here. Thanks Again. Scott
subject: Tomcat Can't See Images or Javascript Subdirectories