Exporting a class and its methods in GWT for use in native JavaScript

300 Views Asked by At

I'm developing a GWT project at the moment and it's been up and running for a while. New functionality that is to be added require extensive testing, visualizing and simulating of a specific algorithm. I would like to export that specific algorithm so that I may call it directly from JavaScript and do some canvas magic.

How can I export a number of classes for direct use in JavaScript from a GWT project?

I've tried using the GWT exporter, following the Getting Started section closely. I've noticed that my output directory contains a new generator class (TestClassExporterImpl.java) but the final JavaScript output contains no trace of my TestClass or the exported methods. I'm sure I've made a mistake somewhere on the way or didn't understand the GWT exporter correctly.

1

There are 1 best solutions below

0
ochakov On

Try to disable obfuscation, it will create the same names in Javascript as in the original Java code