Jan 4th, 2012, 10:25 AM
Is there a way to get a combo GWT and Spring MVC project?
I would like to create a project that uses GWT for the views and request factory for the data with the full client side GWT framework along. But also use Spring MVC for everything else (with the V part being GWT UIBinder templates) and the Entities also having MVC controllers - so that I may add REST services and Spring Security.
If this is possible I haven't found the magic order. And with even a pure GWT project I have some problems getting it to work with 1.2 Roo. So has anyone tried this and is it possible? I don't know whether to start with a GPE GWT created project or a Roo project, and if Roo project is it best to start with mvc or gwt. Then in what order would one create request factories and controllers and scaffolding - The GWT View scaffolding doesn't allow itself to the same editability as the MVC views do, so I assume one has to generate them, then copy them to a knew path and then edit..
Jan 6th, 2012, 10:23 AM
So after a day of researching (the answer was in these forums, but had to find the right search terms - gwt is too small a word for the search engine on these forums), I found why Roo GWT projects weren't working. The POM is not being generated with the request factory plugin info. The fix is here http://forum.springsource.org/showth...ht=#post385963 (and the Update Project Config command is in the right click context menu for the project under Maven -> )
So now I can get a ROO GWT project to work, now off to finding out if and how to integrate Spring MVC into the GWT project.
As an aside, I did try to add ROO nature to a GPE generated GWT project, but it had many fixes needed and I never did get over all the hurdles. It is the Maven nature of the project that doesn't get set right. You have to manually set the project nature to Maven - then there are lots of dependencies that still don't get set right - you also still need to do the request factory fix from above. There is also a required browser restart after changing the project type or the packaging/folder structure gets wonky. That is about where I gave up.
Jan 7th, 2012, 10:26 AM
So it seems from my experiments, you can not have a gwt and mvc in the same project. You can create a roo gwt project and succesfully run web mvc setup. But after that Roo looses the fact that it is a GWT project too and won't let you add any more proxies or requests or scaffolding. So I assume now I have to have two seperate projects and combine the output with a little web.xml tweaking to get what I need.
Jan 7th, 2012, 10:31 AM
Thanks for sharing your findings. I'm sure it will be useful to others.