Tomcat on windows + pages can not link to CSS

cssjsptomcat

we have tomcat on a windows server that everyone on the devteam can access. on this machine the stylesheet/.js links work fine. i copied the war down to my local machine and installed apache on my local machine. Now i can connect to the site at localhost:8080 and the html is served and database connection works but… it does not apply any of the styles/.js .

the other strange thing is that if i browse to the site and view source (at my local machine and at shared machine). the links to the stylesheet look like

href="/project folder/static/styles sub-folder/sub-folder/style-page.css"

there is no "static" folder on either machine. Is this a jsp convention of some sort?

Best Answer

The general convention is to host the "static" stuff on a dedicated web server like Apache and keep the dynamic JSPs etc on the Tomcat.

If you don't see a "static" folder on the source Tomcat server - then I suspect it's sitting under an Apache web server and the URL /static has been mapped in the Tomcat server.xml using a <Context> element.

Related Topic