I need to create javascript library which will be called from other javascript code.
Is it possible to create javascript library using GWT and Java classes? No entry points, no UI - just some utility javascript classes with public static and object methods (e.g. encryption library, image processing library, user input validation library, etc) ?
Any other java to javascript convertion tool is wellcome.
I need to create javascript library which will be called from other javascript code.
Is it possible to create javascript library using GWT and Java classes? No entry points, no UI - just some utility javascript classes with public static and object methods (e.g. encryption library, image processing library, user input validation library, etc) ?
Any other java to javascript convertion tool is wellcome.
Share Improve this question edited Jul 12, 2010 at 20:58 Ned Batchelder 376k77 gold badges579 silver badges673 bronze badges asked Jun 26, 2010 at 21:29 NulldeviceNulldevice 4,0064 gold badges34 silver badges37 bronze badges 1- Check out: code.google.com/p/gwt-exporter – quarks Commented Mar 14, 2013 at 3:57
2 Answers
Reset to default 14Yes, it's possible to write GWT code that other JavaScript on the page can call.
However, I don't know of any projects that currently do this in any large scale, so you maybe blazing a new trail.
The basics of calling GWT code from JS is covered in this GWT blog post from 2008, particularly the section called "Creating JavaScript libraries with GWT" unsurprisingly.
Another project which is linked in that blog post, and maybe of interest to you, is GWT Exporter, which "contains a generator capable of taking GWT classes and exporting them as ordinary Javascript APIs callable from hand-written Javascript without JSNI"
Check out:
https://code.google.com/p/gwt-exporter/
Develop an application or library in GWT and use gwtexporter annotations to make classes and methods available from javascript.