Can anyone tell me how to use GWTquery along with GWT? The GWTquery tutorial page mainly deals with how to use jQuery, it doesn’t much explain how to embed it. If, for example, I want to use it with the default Stockwatcher app that comes with GWT, and use jQuery inside the java file just like the GWTquery tutorial says, where to install the jar file, and how to import it?
Share
GWTquery does not use jQuery, it is
jQuery-likeAPI implemented in GWT and it does not require jquery.js file inside GWT library or html host page, you can easily add its jar file like other gwt library:Maven Setup
If you want to add GQuery on an existing maven project or you don’t want to use the maven archetype, you have simply to add the following lines in your pom.xml file :
You could be interested in setting up your project by hand if you don’t want to use maven, or it is an already created project.
First you’ll need to download the latest stable version of the gwtquery library related to your GWT version and place it in your classpath.
If you’re an experienced GWT user, you probably already know how to do this, but if you’re a beginner, here’s a quick refresher.
First, create a new project by running
which will create a bunch of files containing a sample project. Find the build.xml file and edit the section with id=”project.class.path” adding
If you’re using Eclipse, you may also want to edit the .classpath file and add the following:
Next, edit the src/gwtquery/sample/Sample.gwt.xml file or your project’s existing module file, and add the following line to import GQuery into your GWT module:
Finally, in your module entry point class (e.g. src/gwtquery/sample/client/Sample.java) add the following import statements to make GQuery easy to use:
More information.