Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

java

gwt

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?

like image 718
Suresh Atta Avatar asked Feb 28 '13 19:02

Suresh Atta


1 Answers

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.

like image 197
Adrian B. Avatar answered Oct 19 '22 17:10

Adrian B.