Suresh Atta
Suresh Atta

Reputation: 121998

How to write(enable) Java code in HTML while using GWT 2.5?

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?

Upvotes: 15

Views: 1461

Answers (1)

Adrian B.
Adrian B.

Reputation: 4363

Here is the Google I/O 2012 - The History and Future of Google Web Toolkit you are referring too. And here are the slides posted by Ray Cromwell.

Upvotes: 2

Related Questions