Archive

Posts Tagged ‘GWT’

Yesterday : Gwt happy hours

June 5th, 2008 David Gageot Comments off

Yesterday, Sfeir organized a GWT evening at “La Cantine“. It was a nice event with twelve interesting topics.
Read more…

Tags: ,

Atelier clients riches Web : GWT, Silverlight et Flex, le 19 juin

May 21st, 2008 David Gageot Comments off

Le 19 juin, Valtech Training organise un atelier clients riches Web : GWT, Silverlight et Flex.

A l’heure où Web 2 devient l’expression la plus utilisée de la presse informatique et où les éditeurs se livrent à une escalade d’annonces, nous vous proposons de vous forger votre opinion sur les technologies les plus en vue du monde Rich Internet Application : Flex, GWT et Silverlight.

Après une introduction rapide aux problématiques et solutions du client riche, vous pratiquerez lors de trois ateliers techniques successifs de 2 heures. Vous écrirez donc votre première application dans chacune de ces technologies et serez ainsi amené à juger de leur facilité de mise en œuvre : essayez-les, choisissez !

Je veux m’inscrire !

Tags: , , ,

GWT 1.4.59-RC2 and Maven2

August 24th, 2007 David Gageot Comments off

Gwt 1.4.59-RC2 was just released. If you use Maven2 to build your project, this latest version can be found on xi8ix repository.

Here is the configuration:

<repositories>
    <repository>
        <id>xi8ix</id>
        <url>http://maven.xi8ix.org/</url>
    </repository>
</repositories>
<dependency>
    <groupId>com.google</groupId>
    <artifactId>gwt-user</artifactId>
    <version>1.4.59-RC2</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>com.google</groupId>
    <artifactId>gwt-servlet</artifactId>
    <version>1.4.59-RC2</version>
</dependency>

I had to tweak a few things in my SpringDispatchService. Maybe it’s time to find a more stable solution…

Tags: ,

Gwt and Maven2

August 7th, 2007 David Gageot 2 comments

Trying to use Maven2 to build a GWT project, here is the simplest pom.xml I came up with, starting from Xavier’s

The project can be tested in debug mode with mvn gwt:gwt. It is tested in deployed mode with mvn jetty:run-war

Don’t forget to provide the gwt-user.jar in src/main/webapp/WEB-INF/lib.

Code legend:
Blue parts depend on your project and installation path.
Red part is only needed on a Mac.
Green part makes it easier to use the Jetty plugin.

<project>
  <properties>
    <google.webtoolkit.home>
    /Users/david/Applications/java/gwt-mac-1.4.10/
    </google.webtoolkit.home>
    <google.webtoolkit.extrajvmargs>
    -XstartOnFirstThread
    </google.webtoolkit.extrajvmargs>
  </properties>

  <repositories>
      <repository>
          <id>gwt-maven</id>
          <url>http://gwt-maven.googlecode.com/svn/trunk/mavenrepo</url>
      </repository>
  </repositories>

  <pluginRepositories>
      <pluginRepository>
          <id>gwt-maven</id>
          <url>http://gwt-maven.googlecode.com/svn/trunk/mavenrepo</url>
      </pluginRepository>
  </pluginRepositories>

  <build>
    <plugins>
      <plugin>
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>maven-jetty-plugin</artifactId>
      </plugin>
      <plugin>
        <groupId>com.totsp.gwt</groupId>
        <artifactId>maven-googlewebtoolkit2-plugin</artifactId>
        <version>1.5.1</version>
        <configuration>
            <logLevel>ERROR</logLevel>
            <runTarget>com.valtech.planning.Planning/JnfPage.html</runTarget>
            <compileTarget>com.valtech.planning.Planning</compileTarget>
        </configuration>
        <executions>
            <execution>
                <goals>
                    <goal>compile</goal>
                </goals>
            </execution>
        </executions>
      </plugin>
    </plugins>
  </build>

  <dependencies>
    <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-user</artifactId>
        <version>1.4.10</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-servlet</artifactId>
        <version>1.4.10</version>
    </dependency>
  </dependencies>
</project>
Tags: ,

Spring and GWT integration

August 7th, 2007 David Gageot 1 comment

Googling for ways to integrate GWT with Spring, I didn’t find any simple solution.

Here is what I need :

  • GWT RPC services should be Spring beans.
  • They should be POJOs NOT extending RemoteServiceServlet.
  • Mapping between Servlet paths and beans should be straightforward.

Here is what I came up with :

  • It’s a very simple Servlet that receives every RPC request.
  • It then gets a Spring bean by the name of the Servlet path used for the call.
  • The method call to the bean is done with reflection.

public class SpringDispatchService extends RemoteServiceServlet {
    private final ClassPathXmlApplicationContext context;

    public SpringDispatchServiceImpl() {
        context=new ClassPathXmlApplicationContext(”beans.xml”);
    }

    public String processCall(String payload)
        throws SerializationException {
        try {
            Object target=context.getBean(getServletName());

            RPCRequest rpcRequest=RPC.decodeRequest(
                payload,target.getClass());
            
            Method method=rpcRequest.getMethod();
            Object[] params=rpcRequest.getParameters();

            Object result=method.invoke(target,params);
            
            return RPC.encodeResponseForSuccess(method,result);
        } catch(Throwable ex) {
            return RPC.encodeResponseForFailure(null,ex);
        }
    }
}

Tags: ,