Hello

i am using GWT RPC with Spring. when i process the GWT RemoteService
service RPC.invokeAndEncodeResponse creates RemoteServiceServlet
separate than the RemoteServiceServlet used by Spring. the result is a
null value for getThreadLocalRequest() in GWT RemoteServiceServlet.

My question is how can i dispatch Spring RemoteServiceServlet to the
GWT RemoteServiceServlet to pass servlet request and response up to
GWT???

public class GwtRpcController extends RemoteServiceServlet implements
                Controller, ServletContextAware {

        private RemoteService remoteService;
        private ServletContext servletContext;

        private Class remoteServiceClass;

        public ModelAndView handleRequest(HttpServletRequest request,
                        HttpServletResponse response) throws Exception {
                super.doPost(request, response);
                return null;
        }

        @Override
        public String processCall(String payload) throws
SerializationException {
                try {
                        RPCRequest rpcRequest = RPC.decodeRequest(payload,
                                        this.remoteServiceClass);
                        // delegate work to the spring injected service

                        String response = 
RPC.invokeAndEncodeResponse(this.remoteService,
                                        rpcRequest.getMethod(), 
rpcRequest.getParameters());

                        return response;
                } catch (IncompatibleRemoteServiceException ex) {
                        getServletContext()
                                        .log(
                                                        "An 
IncompatibleRemoteServiceException was thrown while
processing this call.",
                                                        ex);
                        return RPC.encodeResponseForFailure(null, ex);
                }
        }

        @Override
        public ServletContext getServletContext() {
                return servletContext;
        }

        public void setRemoteService(RemoteService remoteService) {
                this.remoteService = remoteService;
                this.remoteServiceClass = this.remoteService.getClass();
        }

        @Override
        public void setServletContext(ServletContext servletContext) {
                this.servletContext = servletContext;
        }

}

thanks

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to