Hello,
I am running
Tomcat 5.54 app server from Eclipse Indigo under Windows 7 Ultimate. My
servlet is using a .jsp and the .jsp page contains (among others) the following to "include" some JavaScript into the .jsp:
<script src="./WebContent/WEB-INF/JSP/Scripts/Modernizr-2.5.3.js" asynch defer></script>
When the servlet runs the .jsp page is displayed but I get 404 errors like "The requested resource (/MyServer/WebContent/WEB-INF/JSP/Scripts/Modernizr-2.5.3.js) is not available." on all of the .js and .css files that are included in the .jsp page.
The relevant file locations are:
./WEB-INF/JSP the .jsp file
./WEB-INF/JSP/Scripts the .js file
./WEB-INF/JSP/CSS the .css files
In particular, Modernizr-2.5.3.js is located (as managed by Eclipse) at .\Projects\MyServer\WebContent\WEB-INF\JSP\Scripts\Modernizr-2.5.3.js. I understand that the path to "included" content such as .js, .css, images and such is relative to the location of the submitted URL, not relative to the displayed .jsp and it is my understanding that the best way to handle this is to use a fully qualified path in the src= URL, which I believe I am doing. However, I get 404 errors. I have tried placing Modernizr-2.5.3.js (as a
test case) "all over the place" and I have never been able to eliminate the 404 errors. (I realize I can pull this particular script from the web but that doesn't solve the problem that I have.)
Do I have a mistake in the src= URL? If not, what else would cause these 404 errors?
Thanks for the help.