开发者

Best way to integrate GWT with existing Spring services?

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.


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..


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜