com.vaadin.server
Class GAEVaadinServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.vaadin.server.VaadinServlet
              extended by com.vaadin.server.GAEVaadinServlet
All Implemented Interfaces:
Constants, java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class GAEVaadinServlet
extends VaadinServlet

ApplicationServlet to be used when deploying to Google App Engine, in web.xml:

      <servlet>
              <servlet-name>HelloWorld</servlet-name>
              <servlet-class>com.vaadin.server.GAEApplicationServlet</servlet-class>
              <init-param>
                      <param-name>application</param-name>
                      <param-value>com.vaadin.demo.HelloWorld</param-value>
              </init-param>
      </servlet>
 
Session support must be enabled in appengine-web.xml:
      <sessions-enabled>true</sessions-enabled>
 
Appengine datastore cleanup can be invoked by calling one of the applications with an additional path "/CLEAN". This can be set up as a cron-job in cron.xml (see appengine documentation for more information):
 <cronentries>
   <cron>
     <url>/HelloWorld/CLEAN</url>
     <description>Clean up sessions</description>
     <schedule>every 2 hours</schedule>
   </cron>
 </cronentries>
 
It is recommended (but not mandatory) to extract themes and widgetsets and have App Engine server these statically. Extract VAADIN folder (and it's contents) 'next to' the WEB-INF folder, and add the following to appengine-web.xml:
      <static-files>
           <include path="/VAADIN/**" />
      </static-files>
 
Additional limitations:

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.vaadin.server.VaadinServlet
VaadinServlet.RequestType
 
Field Summary
 
Fields inherited from interface com.vaadin.server.Constants
ATMOSPHERE_MISSING_ERROR, DEFAULT_BUFFER_SIZE, DEFAULT_THEME_CACHETIME, DEFAULT_THEME_NAME, DEFAULT_WIDGETSET, ERROR_NO_UI_FOUND, INVALID_ATMOSPHERE_VERSION_WARNING, INVALID_SECURITY_KEY_MSG, MAX_BUFFER_SIZE, NOT_PRODUCTION_MODE_INFO, PARAMETER_VAADIN_RESOURCES, PARAMETER_WIDGETSET, PORTAL_PARAMETER_VAADIN_RESOURCE_PATH, PORTAL_PARAMETER_VAADIN_THEME, PORTAL_PARAMETER_VAADIN_WIDGETSET, PUSH_NOT_SUPPORTED_ERROR, REQUIRED_ATMOSPHERE_RUNTIME_VERSION, SERVLET_PARAMETER_CLOSE_IDLE_SESSIONS, SERVLET_PARAMETER_DISABLE_XSRF_PROTECTION, SERVLET_PARAMETER_HEARTBEAT_INTERVAL, SERVLET_PARAMETER_LEGACY_PROPERTY_TOSTRING, SERVLET_PARAMETER_PRODUCTION_MODE, SERVLET_PARAMETER_PUSH_MODE, SERVLET_PARAMETER_RESOURCE_CACHE_TIME, SERVLET_PARAMETER_UI_PROVIDER, THEME_DIR_PATH, URL_PARAMETER_THEME, WARNING_HEARTBEAT_INTERVAL_NOT_NUMERIC, WARNING_LEGACY_PROPERTY_TOSTRING, WARNING_PUSH_MODE_NOT_RECOGNIZED, WARNING_RESOURCE_CACHING_TIME_NOT_NUMERIC, WARNING_UNKNOWN_LEGACY_PROPERTY_TOSTRING_VALUE, WARNING_XSRF_PROTECTION_DISABLED, WIDGETSET_DIR_PATH, WIDGETSET_MISMATCH_INFO
 
Constructor Summary
GAEVaadinServlet()
           
 
Method Summary
protected  VaadinSession getApplicationContext(javax.servlet.http.HttpServletRequest request, com.google.appengine.api.memcache.MemcacheService memcache)
           
protected  int getMaxInactiveIntervalSeconds(javax.servlet.http.HttpSession session)
          Returns the maximum inactive time for a session.
protected  void sendCriticalErrorNotification(VaadinServletRequest request, VaadinServletResponse response)
           
protected  void sendDeadlineExceededNotification(VaadinServletRequest request, VaadinServletResponse response)
           
protected  void sendNotSerializableNotification(VaadinServletRequest request, VaadinServletResponse response)
           
protected  void service(javax.servlet.http.HttpServletRequest unwrappedRequest, javax.servlet.http.HttpServletResponse unwrappedResponse)
          Receives standard HTTP requests from the public service method and dispatches them.
 
Methods inherited from class com.vaadin.server.VaadinServlet
createDeploymentConfiguration, createServletService, createVaadinRequest, criticalNotification, destroy, getApplicationUrl, getCurrent, getDefaultTheme, getRequestType, getResourcePath, getService, handleContextRootWithoutSlash, init, isAllowedVAADINResourceUrl, isStaticResourceRequest, safeEscapeForHtml, servletInitialized, stripSpecialChars, writeStaticResourceResponse
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GAEVaadinServlet

public GAEVaadinServlet()
Method Detail

sendDeadlineExceededNotification

protected void sendDeadlineExceededNotification(VaadinServletRequest request,
                                                VaadinServletResponse response)
                                         throws java.io.IOException
Throws:
java.io.IOException

sendNotSerializableNotification

protected void sendNotSerializableNotification(VaadinServletRequest request,
                                               VaadinServletResponse response)
                                        throws java.io.IOException
Throws:
java.io.IOException

sendCriticalErrorNotification

protected void sendCriticalErrorNotification(VaadinServletRequest request,
                                             VaadinServletResponse response)
                                      throws java.io.IOException
Throws:
java.io.IOException

service

protected void service(javax.servlet.http.HttpServletRequest unwrappedRequest,
                       javax.servlet.http.HttpServletResponse unwrappedResponse)
                throws javax.servlet.ServletException,
                       java.io.IOException
Description copied from class: VaadinServlet
Receives standard HTTP requests from the public service method and dispatches them.

Overrides:
service in class VaadinServlet
Parameters:
unwrappedRequest - the object that contains the request the client made of the servlet.
unwrappedResponse - the object that contains the response the servlet returns to the client.
Throws:
javax.servlet.ServletException - if an input or output error occurs while the servlet is handling the TRACE request.
java.io.IOException - if the request for the TRACE cannot be handled.

getMaxInactiveIntervalSeconds

protected int getMaxInactiveIntervalSeconds(javax.servlet.http.HttpSession session)
Returns the maximum inactive time for a session. This is used for handling the expiration of session related information in caches etc.

Parameters:
session -
Returns:
inactive timeout in seconds, greater than zero

getApplicationContext

protected VaadinSession getApplicationContext(javax.servlet.http.HttpServletRequest request,
                                              com.google.appengine.api.memcache.MemcacheService memcache)
                                       throws javax.servlet.ServletException
Throws:
javax.servlet.ServletException


Copyright © 2000-2014 Vaadin Ltd. All Rights Reserved.