2

I have been able to use Jquery with ASP.NET because I know where to drop the JQuery Library, but I am trying to integrate JQuery with Java Web Applications using JSP's,Servlets, etc.

It seems like a trivial question, but for some reason I am unable to figure out where to drop the JQuery Javascript file.

4 Answers 4

3

Put it under your web structure. (i.e.)

webroot/static/scripts/jquery/jquery.js

So you can acces from: http://host:port/webroot/static/scripts/jquery/jsquery.js

The web structure is kindly arbitrary (expect for the WEB-INF directory). All the resource are public under the root, expect (again) the resources under WEB-INF.

I hope it helps you.

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

Comments

2

If you have access to modify headers of html files you can load the jQuery library with Google CDN for Ajax Libraries without having to drop it physically on your server anywhere.

Comments

0

If you use RichFaces, jQuery support is pretty-much built-in. You can use jQuery on your page after doing this, in the head section:

<a4j:loadScript src="resource://jquery.js"/>

Then you can use jQuery by calling "jQuery('selector goes here')". Richfaces uses '$' for it's own purposes, so calling "$('selector goes here')" won't work.

Comments

0

In modern Digital web platforms, put jquery.js in a folder /javascripts following the Twitter Bootstrap convention.

If you are using JSF 2.x then under folder /resources/javascripts

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.