1

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.

2
  • 1
    Very broad request here - suggest finding some tutorials with step-by-step, get it working then modify them as a learning tool. Commented Jan 23, 2013 at 23:43
  • good idea...if I'll find some solution, I'll write some toutorial :) Commented Jan 24, 2013 at 17:27

1 Answer 1

2

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.