Stanley Shyiko's Blog

Daily IT stuff

Archive for the ‘Jetty’ Category

Making GWT DevMode embedded Jetty server play with Vaadin

with 2 comments

Vaadin can be of great help if you need to develop web application quickly and without much effort. Of course, there is a price to pay (like performance, scalability, etc.) but in overall it’s a quite interesting framework.

One thing I was not expecting to see was necessity to store results of GWT widgets compilation inside <web application root>/VAADIN/widgetsets directory. At first, this seems like not a big deal. But eventually it becomes clear that running both GWT hosted mode shell and external web server (as shell’s -war parameter points to web application root and GWT output directory (which in case of Vaadin differs), prohibiting embedded servlet container from correct work) is a bit odd.

So, the trick is to specify correct <web application root> directory and use it through custom servlet container launcher (source code is available here). I’ve used it on Intellij IDEA but same should  apply to Eclipse, as launch configurations are similar.

Intellij IDEA Run Configuration example (Application type):

Main class: com.google.gwt.dev.DevMode
VM parameters: -Ddev.mode.app.root=target/project-name
Program parameters: -server com.github.shyiko.gists.vaadin.DevModeJettyLauncher -war target/project-name/VAADIN/widgetsets com.example.ProjectNameWidgetSet -startupUrl http://localhost:8888/

If you do not want to build vaadin-gwt-jetty-launcher.jar yourself take it from here. It should be available on the classpath when GWT shell starts.

Written by Stanley Shyiko

06/26/2011 at 8:23 pm

Posted in GWT, Intellij IDEA, Jetty, Vaadin