Frage

I want to create simple app, that would use css and js. But I can't reach that static content... I've found some solutions, but I wasn't able to modify them for my solution :(

Would be anybody please so kind and could show some explicit solution (where to add/modify something and what exactly to add/modify) ?

my app structure in navigator: http://i.nahraj.to/f/gNc.jpg

Content of web.xml and servlet-context.xml http://pastebin.com/fVcNZPst

I'm running my app on tomcat server.

The home.jsp page is correct, because when I rewrite it to home.html and open it via web browser, it shows correctly. I would really appreciate any help.

War es hilfreich?

Lösung

There are a few issues in your structure:

a. You have put <resources mapping="/resources/**" location="/resources/" /> for mapping your resources, this would map anything with uri starting with /resources/ to locations under your webapp, in your structure that would be src/main/webapp/resources, you however don't have that folder.

b. If you want your files from webapp/css, webapp/img, webapp/js to be available either you can move them into src/main/webapp/resources folder and access them with say /resources/js/test.js uri or just put this entry into your servlet-context.xml file also - <mvc:default-servlet-handler /> - if you are interested I have provided more details here

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top