GWT JSON integration with Spring MVC

In the previous post, I’ve presented GWT RPC integration with Spring. In this post we’ll see how we can achieve JSON backend service integration between GWT and Spring MVC. We’ll re-use the same StockWatcher application and change the RPC communication into JSON requests.

Read more of this post

Advertisements

GWT RPC integration with Spring

Recently I started studying GWT, a new web framework for my curriculum. The main idea of GWT is to let you code the GUI part in Java (with static compilation and type checking) then translate this code into Javascript.

For the backend, GWT relies on an RPC system using plain old Servlet. Each RPC service is published as a distinct servlet so you end up having as many servlets are there are distinct RPC services.

Not only this approach is not optimal for resources management server-side wise, it also pollutes your web.xml with many servlet declarations.

Ideally we should have an unique servlet serving as a router and dispatching RPC calls to appropriate service beans managed by Spring. Spring is an appropriate framework for managing business in the backend due to its industry-wide adoption and its mature extensions portfolio. Needless to say that this design can be easily adapted for JEE containers too.

Disclaimer: the code presented below has been inspired from projects like spring4GWT and gwtrpc-spring. I took the same approach and modified the URL mapping part so the original credits go for them.

Read more of this post

Java 8 Lambda in details part V : Functional interface definition and lambda expression implementation

In this last post we’ll look at the functional interface formal definition and the way lambda expressions are implemented.

Read more of this post

Java 8 Lambda in details part IV : Multiple inheritance resolution for defender methods

In this post we’ll look at conflict resolution rules for multiple inheritance introduced along with defender methods in JDK 8.

Read more of this post

Java 8 Lambda in details part III : Method and constructor referencing

In this third post dedicated to Java 8 Lambda expressions, we’ll look at the new :: operator introduced to allow method and constructor referencing.
Read more of this post

Java 8 Lambda in details part II : Scoping of “this” and “effectively final” variable semantic

In this second post, we’ll look at the scoping of the this keyword inside a lambda expression and the semantic of the so called “effectively final” local variables.
Read more of this post

Java 8 Lambda in details part I : Closure and Mutability

This article is the first one of a serie dedicated to Java 8 Lambda expressions. The purpose is not to introduce the main concepts of lambda expressions, many blogs over there do it very well. The idea is to
shed some light on tricky details and side effects. If you’re not familiar with the new lambda-related features in Java 8, I strongly advise to look at the following article http://cr.openjdk.java.net/~briangoetz/lambda/lambda-state-4.html

Today we’ll look at the mutability issue when dealing with closures.

Read more of this post