Boden
Boden

Reputation: 4167

Easiest way to add GWT to a Spring MVC application?

I've got a Spring MVC application and I've decided that I'd like to try using GWT for the front end. I'd like to continue using MVC as I'll also be using Spring Security and some other springy stuff.

I'm aware of the GWT-SL project, and I guess I'll use it. The documentation is light on examples unfortunately.

What I'm wondering now is.... how do I reconfigure my project so that I can use GWT? I'm assuming that I'll lose the ability to run in hosted mode, and I suppose that's ok. Do I just add the GWT and GWT-SL jars, reconfigure my web.xml, and add a package to my project for the GWT code?

I'm using Eclipse 3.4. My existing project is standard web project.

Upvotes: 6

Views: 6171

Answers (3)

alex.b
alex.b

Reputation: 1528

I have posted a view month ago my simple project (3 classes) how to integrate GWT with existing Spring MVC application. Simple sample also provided.

Try it, it is clear and simple: http://code.google.com/p/gspring.

Upvotes: 1

thehighspirit
thehighspirit

Reputation:

With the new version of the GWT plugin, you'd have all the benefits of the hosted mode browser without having to modify any options. The GWTHandler from the GWT-SL will take care of your rpc call mapping. However, you will have a problem with your existing domain objects structure. You will either have to put them in GWT's 'client' package, or mirror your existing domain objects to enable them to be compiled to javascript. I have been looking for a stable non-invasive framework for doing this, but have yet to find one. Gilead looks promising, but you will have to extend its classes on your domain.

Upvotes: 1

Robert Munteanu
Robert Munteanu

Reputation: 68278

You won't lose hosted mode. I don't know if you're using the internal server for that - I use -noserver so I can't help you there.

Other than that, I guess the documentation is quite clear. Have you hit any specific problems?

Upvotes: 0

Related Questions