org.gwtwidgets.server.spring
Class GWTSpringController

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
              extended by com.google.gwt.user.server.rpc.RemoteServiceServlet
                  extended by org.gwtwidgets.server.spring.GWTSpringController
All Implemented Interfaces:
com.google.gwt.user.client.rpc.RemoteService, com.google.gwt.user.server.rpc.SerializationPolicyProvider, java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, org.springframework.web.context.ServletConfigAware, org.springframework.web.context.ServletContextAware, org.springframework.web.servlet.mvc.Controller

public class GWTSpringController
extends com.google.gwt.user.server.rpc.RemoteServiceServlet
implements org.springframework.web.context.ServletContextAware, org.springframework.web.context.ServletConfigAware, org.springframework.web.servlet.mvc.Controller, com.google.gwt.user.client.rpc.RemoteService

Simple spring controller that merges GWT's RemoteServiceServlet, the Controller and also implements the RemoteService interface so as to be able to directly delegate RPC calls to extending classes.

Author:
George Georgovassilis, g.georgovassilis[at]gmail.com
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
perThreadRequest, perThreadResponse
 
Constructor Summary
GWTSpringController()
           
 
Method Summary
static javax.servlet.http.HttpServletRequest getRequest()
          Deprecated. Use ServletUtils.getRequest()
static javax.servlet.http.HttpServletResponse getResponse()
          Deprecated. Use ServletUtils#getResponset()
 javax.servlet.ServletContext getServletContext()
           
 org.springframework.web.servlet.ModelAndView handleRequest(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
protected  void preprocessHTTP(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Disables HTTP response caching by modifying response headers for browsers.
 void setServletConfig(javax.servlet.ServletConfig configuration)
           
 void setServletContext(javax.servlet.ServletContext servletContext)
           
 
Methods inherited from class com.google.gwt.user.server.rpc.RemoteServiceServlet
checkPermutationStrongName, doGetSerializationPolicy, getSerializationPolicy, onAfterResponseSerialized, onBeforeRequestDeserialized, processCall, processPost, shouldCompressResponse
 
Methods inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
doPost, doUnexpectedFailure, getPermutationStrongName, getThreadLocalRequest, getThreadLocalResponse, onAfterRequestDeserialized, readContent
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GWTSpringController

public GWTSpringController()
Method Detail

preprocessHTTP

protected void preprocessHTTP(javax.servlet.http.HttpServletRequest request,
                              javax.servlet.http.HttpServletResponse response)
Disables HTTP response caching by modifying response headers for browsers. Can be overridden by extending classes to change behaviour.

Parameters:
request -
response -

setServletContext

public void setServletContext(javax.servlet.ServletContext servletContext)
Specified by:
setServletContext in interface org.springframework.web.context.ServletContextAware

getServletContext

public javax.servlet.ServletContext getServletContext()
Specified by:
getServletContext in interface javax.servlet.ServletConfig
Overrides:
getServletContext in class javax.servlet.GenericServlet

getRequest

@Deprecated
public static javax.servlet.http.HttpServletRequest getRequest()
Deprecated. Use ServletUtils.getRequest()

Return the request which invokes the service. Valid only if used in the dispatching thread.

Returns:
the servlet request associated with the thread servicing the current RPC

getResponse

@Deprecated
public static javax.servlet.http.HttpServletResponse getResponse()
Deprecated. Use ServletUtils#getResponset()

Return the response which accompanies the request. Valid only if used in the dispatching thread.

Returns:
the servlet response associated with the thread servicing the current RPC

handleRequest

public org.springframework.web.servlet.ModelAndView handleRequest(javax.servlet.http.HttpServletRequest request,
                                                                  javax.servlet.http.HttpServletResponse response)
                                                           throws java.lang.Exception
Specified by:
handleRequest in interface org.springframework.web.servlet.mvc.Controller
Throws:
java.lang.Exception

setServletConfig

public void setServletConfig(javax.servlet.ServletConfig configuration)
Specified by:
setServletConfig in interface org.springframework.web.context.ServletConfigAware


Copyright © 2011. All Rights Reserved.