Good day,
I have searched far and wide but all I can find is information about how to add various plugins to Eclipse. I don\'t want a plugin. I want my stinkin\' jQu
That is correct. You should move the 'js' folder above WEB-INF folder. Then the js file will get picked up by your JSP.
Include jquery.js in your project
<script type="text/javascript" src="/js/jquery-1.4.3.min.js"></script>
or (to include your context path in the reference if you are using JSTL mapped to prefix "c")
<script type="text/javascript" src="<c:url value="/js/jquery-1.4.3.min.js">"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js" type="text/javascript"></script>
I think you need to locate the file NOT under the WEB-INF directory, as anything there is not visible to the HTML resulting from your JSP. Try putting your js directory directly under WebContent and changing your reference in the tag accordingly.
EDIT: In response to the comment you left under Jay's answer. How are you referencing the file in your script tag?
You will probably want something like:
<script type="text/javascript" src="/<web-context-root>/js/jquery-1.4.3.min.js"></script>
where web-context-root is specific to your application and assuming you put your js directory directly under WebContent.
You could try using a separate servlet (which I have actually not tried yet) to load up the jQuery.js as static content.
What solved it for me, is putting the jQuery.js file in the /content folder with the rest of html pages, and referencing it relative to root directory for both jsp and html pages.
The advice to move my jquery library to such-and-such a location was correct, with a small exception. A new servlet is required to serve up static content files. If anyone else has this problem, something like this should fit the bill:
<servlet>
<servlet-name>statCont</servlet-name>
<servlet-class>
org.apache.catalina.servlets.DefaultServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>statCont</servlet-name>
<url-pattern>*.js</url-pattern>
</servlet-mapping>
Why are your JSPs in WEB-INF? They are created in 'WebContent' folder. WEB-INF folder should not be included in the class path.
Don't put your work in WEB-INF folder.