1

I know is likely that this question has been asked many times before. I've googled a lot but I still don't have a clear answer, and I'm getting crazy.

I have to start a new project which consists of creating the GUI layer using GWT of a backend application for which a project already exists. This project is based on Spring 3.0 and it already have a persistence and service layer. The service layer was used by a Flex client, which is the one I have to replace now by a GWT based app.

I've read many things about gwt and spring integration, i.e. using libraries like spring4gwt (it seems to be outdated), gwt-sl, etc. I've read also a bit about RequestFactory instead of GWT-RPC, and the MVP pattern, which seems to be a good approach for a complex application (my app will have more than 60 different screens), but I don't know if it can be integrated with Spring.

What I can see is that the GWT world is moving fast, so for today, when GWT 2.1.1 is out, can somebody tell me, which is the best way to integrate GWT with an existing Spring project?

If it can have influence on the answers, I want to note that I have the intention of integrating Spring Security as well.

Thanks.

Majid Laissi
  • 19,188
  • 19
  • 68
  • 105
  • I have to say that I was making questions without diving too deep in the GWT documentation and study about it. Now I have it clear. I have chosen mvp4g as the MVP framework, and GWT-dispatch for communicating with the server following the command pattern. As always the correct way is to study the technology properly and then ask, but sometimes we want to go too fast. This was my case. – Daniel Francisco Sabugal Jan 17 '11 at 10:32
  • it is beyond my understanding why people always start with Spring and then look at what they need, as if it is the best fit for EVERYTHING. – koma Nov 22 '12 at 22:21

2 Answers2

1

I am using spring4gwt to convert gwt servlets to spring beans.. It is just a simple class, and functions properly..

If you need DI for gwt layer , you should consider GIN..

Gursel Koca
  • 20,940
  • 2
  • 24
  • 34
0

I'm not sure this is the best way but I use the utility method like following

public static Object getDao(String daoName,GenericServlet gs) {
    ServletContext context = gs.getServletContext();
    WebApplicationContext applicationContext = WebApplicationContextUtils.getWebApplicationContext(context);
    return applicationContext.getBean(daoName);
}

My serivce class extend the RemoteServiceServlet (I'm using GWT-RPC) which is the subclass of GeneraicServlet.

zawhtut
  • 8,335
  • 5
  • 52
  • 76