Trifork Blog

Posts Tagged ‘GWT’

Getting GWT to work with Servlet 3 Async Requests

February 25th, 2011 by

For one of our projects, we use a GWT client that needs to be updated in near-real time (< 1 second delay) when something relevant happens on the server. There are multiple ways of doing it, but I tried to get it working with the new Servlet 3 feature: Asynchronous Http Request handling.

Read on to find out how I got it done.

Read the rest of this entry »

JTeam Technology Matrix: The Stars

September 7th, 2009 by

In Alef’s previous blog entry about the JTeam Technology Matrix, he explained the basic idea of using a BCG-matrix to classify technologies. In this blog entry I’ll focus on the ‘Star’ section of our current matrix and highlight some of the technologies that are currently in there. Star technologies are the technologies that bring us added value in the projects that we do, but are also cool and innovative to use. Please keep in mind that the content of the matrix is under constant discussion and is subject to change. This overview should therefore be considered a snapshot of today’s matrix.
Read the rest of this entry »

Test driven development for GWT UI code with asynchronous RPC

April 22nd, 2008 by

In my previous blog post I we saw a test-driven approach to GWT UI code. This was based on moving logic to a Supervising Controller.
In this follow-up post we’ll turn our attention to interacting with RPC, and see how this can be tested using EasyMock. This involves some tricks and non-trivial boilerplate code, but fortunately most of this can be hidden by introducing convenience methods, and we end up with tests that are expressive and easy to read.
This article continuous on the sample code in my previous blog post, but if you’re just interested in the RPC part you can probably skip that and start from here. Familiarity with EasyMock basics is assumed.

Read the rest of this entry »

Test driven development for GWT UI code

March 9th, 2008 by

Is a test driven development (TDD) approach possible when creating a GUI using GWT? This post is about how to apply MVC (Model-View-Controller) to organize GWT UI code, with these objectives:

  1. a clear separation of the controller logic from presentation and model
  2. full testability of the controller logic independent of the (browser or hosted mode) GWT environment.

We will see how this can be realized by adding a few simple classes to the standard set of GWT widgets, and applying an MVC flavor described by Martin Fowler as Supervising Controller.
The sample code shows how tests can provide a programmatic alternative for tests you would otherwise have to perform manually by interacting with the UI of the deployed application.

Read the rest of this entry »

Optimizing startup time for GWT hosted mode

November 30th, 2007 by

When developing GWT (Google Web Toolkit) applications, the GWT hosted mode is an invaluable tool, as it allows for short development cycles. Whenever you change something in the GWT client code and hit the “Refresh” button it will compile the change, reload the application and show the result of my change almost immediately. In theory, that is…
As soon as the GWT client code grows in size, it takes longer and longer to refresh, to the point that it becomes unacceptable.
In this blog I’ll explore this issue, discuss its causes and what you can do about it.

Read the rest of this entry »

Integrating Spring and GWT

June 4th, 2006 by

I just completed my first shot at integrating Spring with GWT. You can check it out here

Here’s what you do to expose a simple service.

1) Write the remote service, note that the service no longer extends RemoteServiceServlet however HelloService should still implement RemoteService

public class HelloServiceImpl implements HelloService {
public String sayHello(String name) {
return "hello " + name;

2) Define this service in your application context

<bean id=”helloService” class=”nl.jteam.hello.server.HelloServiceImpl”/>

3) expose the bean as a gwt service

<bean id=”defaultHandlerMapping” class=”org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping”/>

<bean name=”/helloService” class=”nl.jteam.gwt.exporter.GwtInvokerServiceExporter”>
<property name=”service” ref=”helloService”/>
<property name=”serviceInterface” value=”nl.jteam.hello.client.HelloService”/>

4) Change the clientcode to point to your Spring service. be sure to use an absolute url while running in hosted mode or it will complain

helloService = (HelloServiceAsync) GWT.create(HelloService.class);
ServiceDefTarget endpoint = (ServiceDefTarget) helloService;

Feedback is appreciated