Re: How to integrate Jsoup in GWT

302 views
Skip to first unread message

Andy King

unread,
Jan 4, 2013, 1:36:40 PM1/4/13
to google-we...@googlegroups.com
It appears that Jsoup may be intended for use on the server-side of the application, and yet you are using it on the client side.  If you want to use it in the client then you'll have to make the source code available to the GWT compiler, and the source is in the jsoup-1.7.1-sources.jar file.  Are you sure you want to execute the Jsoup routines from the client?  I would probably run Jsoup on the server and communicate with it from the client using GWT RPC.

On Friday, January 4, 2013 4:20:51 AM UTC-7, Kaustav Mukherjee wrote:

I am trying to develop a simple app with Jsoup. For that, I have replaced the default code in the StockWatcher.java file from GWT with my code, which requires Jsoup. I have downloaded the Jsoup jar file from http://jsoup.org/download (the first link), and placed it in the StockWatcher/war/WEB-INF/lib folder. After this, the Jsoup classes are imported into the class all right (there is no red colored cross sign on those import lines), but while trying to run the app, I am getting an error as shown in the figure. Can anyone give me a step by step help on what to do now? I am new to GWT.



Kaustav Mukherjee

unread,
Jan 9, 2013, 1:48:31 AM1/9/13
to google-we...@googlegroups.com
Can you tell me how to implement the jSoup on the server-side? That is, what to do with jSoup jar file downloaded from the official site so that I can use it in the server side script to scrape web pages?

Philippe Lhoste

unread,
Jan 10, 2013, 4:33:35 AM1/10/13
to Google-We...@googlegroups.com
On 09/01/2013 07:48, Kaustav Mukherjee wrote:
> Can you tell me how to implement the jSoup on the server-side? That is, what to do with
> jSoup jar file downloaded from the official site so that I can use it in the server side
> script to scrape web pages?

You have put the code using Jsoup, as you show in the screenshot, in a package with
'client' in the path. You have to put it in a package with 'server' in the path...
See also the base GWT tutorials.

--
Philippe Lhoste
-- (near) Paris -- France
-- http://Phi.Lho.free.fr
-- -- -- -- -- -- -- -- -- -- -- -- -- --

Reply all
Reply to author
Forward
0 new messages