Hi,
In a GWT based project we had a "login" mechanism which needed https protocol to be used. As GWT provides convienient ways of doing the same by using RequestBuilder class. We were using Spring framework at our server side. For handling GWT - RPC requests we were using the GWTHandler as mentioned in one of my previous posts GWT with Spring.
But now the issue was how to integrate https based requests into the project and into Spring. This was required because all the dependencies were being injected through spring. We figured out a simple solution; all the servlets that were extending from HttpServlet now were now extending from an abstract custom servlet class. This class was implementing the Spring mvc's Controller interface and also had one abstract method containing HttpRequest and HttpResponse objects as arguements. All the processing was done in this method. The handle request method returned a null and all the response was written in the response header. Since we had 2 different ways of hitting the server. The following mapping was added into the myapp-servlet.xml file.
< !-- Handler mappings for GWT - RPC calls -- >< bean class="org.gwtwidgets.server.spring.GWTHandler" >
< property name="mappings" >
< map >
< entry key="/myApp/myAppService.rpc"
value-ref="myAppRpcService" / >
< / map >
< / property >
< / bean >
< !-- Handler mappings for GWT - Http calls -- >
< bean class="org.springframework.
web.servlet.handler.SimpleUrlHandlerMapping" >
< property name="mappings" >
< props >
< prop key="/myApp/login.rpc">myAppLogin < / prop >
< / props >
< / property >
< / bean >
Needless to say that myAppRpcService and myAppLogin are the bean id's of beans defined in the spring context file.
I hope this post will be helpful to those who are trying to integrate gwt with spring.