I've started taking advantage of GWT 2.5. The coolest feature of GWT 2.5 was the ability to write Java code directly in our HTML pages like so:
<script type="text/java">
String helloWorld = "Hello world";
Window.alert(helloWorld);
</script>
The trick is to use a ServletFilter on the server side. This ServletFilter uses the GWT compiler to compile this java code into Javascript and inject it into the HTML returned to the client.
I am unable to figure out how to filter this in web.xml or how to pass information to the compiler. How can I do this?
SuperDevModeandElementalcan do together, by simply code aServletFilterthat catches every<script type="text/java">in anhtmlpage, synthesizes an on-the-fly module entry point, compiles in one second and replaces the script content with the output of the compilation. Unfortunately I don't think such a filter is available, you should ask Ray directly, through the G+ community, or the GWT-contributors group.