1

I downloaded jquery library and added it to WebContent/js folder in Spring MVC project. In my jsp file i have a line but when i try to use jquery functions, it doesnt work. When i replace source path to "http://code.jquery.com/jquery-latest.js" it works fine. Jsp files are located in "WebContent/WEB-INF/jsp" folder. What is the correct path to jquery library?

1
  • So you have a bad path to that folder. what is the question?! Commented Feb 6, 2012 at 17:55

1 Answer 1

3

Check out this answer. Basically you need to use the <c:url /> tag to generate the correct relative path to your script.

In your case, you'll want to use:

<script src="<c:url value='/js/jquery.js' />"></script>
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.