Search code examples
javagwtsharethis

ShareThis GWT Integration


Is there a ShareThis integration with GWT?

Using Errai templating, our app can show ShareThis widget using the same HTML code, the problem is, it is sharing only the base URL like:

http://www.ourgwtapp.com whereas the actual URL that needs to be shared is http://www.outgwtapp.com/#Page1;id=123

Is there a way for JSNI to force the share Title and URL to some specific values?


Solution

  • Don't know about the actual ShareThis code, but this http://www.gwtproject.org/javadoc/latest/com/google/gwt/user/client/Window.Location.html gives you access to the current location of the browser. This should be the URL of your current place and thus the location of the content you want to share.