Q:

How to use external server side jar in GWT?

I want to use jSoup on GWT server side code to be able to scrape web pages. The documentation of GWT does not help in installing external jars. Can anyone tell me how do I install the jSoup jar (downloaded from the official jSoup site) in GWT and use it in the server-side code?

A:

By using eclipse you can do the following:

Download the jsoup.jar
Copy the file to the lib library of the project WEB-INF/lib
Right click on the lib folder inside eclipse Refresh to see the new library.
Add the library to the class path: Right click on the Project -> Build Path -> Configure Build Path -> Add external jar. Browse and add the jar
Write the import jsoup statement inside any server side class and you can use it as usual.

A:

If you are using it via simple GPE eclipse project then keep it in the WEB-INF/lib .
If you are using it via a maven GPE eclipse project then add to runtime classpath scope in dependencies.
Client server interaction in either of the above scenarios:
Step 1 - RPC Call to request processing of URL.
Step 2 - RPC Server side code i.e servlets for requesting and scraping a url http://vjdef.com/home/2011/06/scraping-html-using-java-servlets-and-tagsoup/
Step 3 - RPC Server side code sends back required message post processing to client.
Step 4 - onSucess callback of the Step 1 RPC invocation will receive message.

