26/Mar 2010
3 min. read
For the past few days, I’ve been working on code splitting our existing GWT application. The application is fairly big with about 20k loc (excluding javadoc, comments and tests). The download size (with obfuscated mode) is about 1.5M, and with pretty mode, is a whooping 10+M. Obviously this is not acceptable.
GWT2 provides developer guided code splitting feature. It sounds complicated and under the hood, it may very well be (involves a lot of graph theories to figure out dependencies and so on) but from the user’s point of view, it’s very easy.
9/Mar 2010
8 min. read
Building a GAE+GWT application using the best practices series Part 1 Part 2 Part 3 Part 4 Part 5 In the last post of the series, I’ve shown how to setup a client side GIN+MVP project. This post will discuss the actual building of the UI and GWT-RPC web service calls using GWT-Dispatch on the client side.
Use cases Before we dive into the code, let’s go over again the use cases our little app has.
3/Mar 2010
3 min. read
Building a GAE+GWT application using the best practices series Part 1 Part 2 Part 3 Part 4 Part 5 In the last blog post, we went over how to write GWT-RPC handlers using GWT-dispatch and dependency injection (Guice). This section, we’re going to see how the client side is set up.
Dependencies We need the following dependencies * Gin * GWT-dispatch * GWT-presenter * GWT-log
They need to be on the classpath when you compile your GWT code, but not under the war directory like the server dependencies need to be.
3/Mar 2010
4 min. read
Building a GAE+GWT application using the best practices series Part 1 Part 2 Part 3 Part 4 Part 5 In this part of the series, we’re going to explore the designing of the web services for RateChecker and coding them using the command pattern from GWT-dispatch based on Ray Ryan’s presentation.
The big picture
To correctly implement web services using the command pattern, we first have to get the big picture.
1/Mar 2010
4 min. read
The problem In Java, imagine you have a list of User objects, each encapsulates the user’s id, first name, last name and age. Then you want to call a web service UserService.deleteUsersByIds(List<Integer> userIds) to delete the users from your data store. It doesn’t sound too hard, does it? All you need to do is to transform you List<User> to List<Integer>. So you go ahead and write the following code:
1/Mar 2010
4 min. read
Building a GAE+GWT application using the best practices series Part 1 Part 2 Part 3 Part 4 Part 5 In Part 2, we’re going to go over project setup for GAE and GWT applications, and wire the server (servlet) using Guice and GWT-Dispatch.
Project setup I’m using Eclipse as my development environment. Install Google Eclipse plugin, and install the provided GWT (2.0.2) and GAE (1.3.1) with the plugin.
26/Feb 2010
2 min. read
Building a GAE+GWT application using the best practices series Part 1 Part 2 Part 3 Part 4 Part 5 This is the first installment of the series Building a GAE+GWT application using the best practices.
Introduction In the next few blog posts, I’m going to present my experience building a simple (but non-trivial) web application using GWT and Google App Engine, while applying the best practices introduced by Ray Ryan in his excellent GWT best practices at Google IO last year.
9/Feb 2010
1 min. read
This project aims to add flexibility to GXT row expander by enabling putting arbitrary widgets in the expanded row.
GXT’s grid widget is great, especially with the RowExpander plugin, it allows the creation of a Google Reader style grid (a list with expandable rows). However, the current GXT’s RowExpander design only allows rendering by XTemplate. XTemplate falls short in a number of ways, especially when it comes to user interaction inside the expanded rows.
18/Dec 2009
3 min. read
GWT2 offers a lot of exciting new features: OOPHM, SOYC, code splitting, declarative UI, to name a few. This evening, I experimented setting up a GWT2 project using Codehaus’s gwt-maven-plugin.
I’m using Eclipse, so obviously, you need m2eclipse and Google Eclipse Plugin. First step is creating a Maven project: File->New->Project...->Maven Project
In the archetype selection dialog, select org.codehaus.mojo.gwt-maven-plugin:1.1.
We choose this to create an archetype but 1.1 doesn’t work with GWT2.
18/Nov 2009
3 min. read
This morning at work, I was running our GWT application with some deferred binding logic in it, and all of a sudden I got this ridiculous message:
[ERROR] Class 'mycompany.rebind.HistoryResourceGenerator' must derive from 'com.google.gwt.core.ext.Generator' [ERROR] Failure while parsing XML com.google.gwt.core.ext.UnableToCompleteException: (see previous log entries) at com.google.gwt.dev.cfg.ModuleDefSchema$ObjAttrCvt.convertToArg(ModuleDefSchema.java:729) at com.google.gwt.dev.util.xml.HandlerArgs.convertToArg(HandlerArgs.java:64) at com.google.gwt.dev.util.xml.HandlerMethod.invokeBegin(HandlerMethod.java:214) at com.google.gwt.dev.util.xml.ReflectiveParser$Impl.startElement(ReflectiveParser.java:257) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Abstract...) It was running fine yesterday when I left work, and now it tells me that my generator isn’t a subclass of the GWT Generator?
19/Mar 2009
3 min. read
Many web API authors are using third party libraries like JayRock to convert ASP.NET web service method return values to JSON. ASP.NET does have the ability to return JSON objects for web methods. It’s not a very well-known feature (I guess) as there are only a few places mentioning it.
For example, suppose the web method we are calling is /ItemService.asmx/GetList, and it’s expecting a parameter “uid”. For JSON web service to work, we have to set the request content type to “application/json” and provide the request parameter as a JSON object and send it through HTTP POST data ({uid:'12345'}).