Class GAEVaadinServlet

  • All Implemented Interfaces:
    Constants, 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>UI</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:
    • Do not change application state when serving an ApplicationResource.
    • Avoid changing application state in transaction handlers, unless you're confident you fully understand the synchronization issues in App Engine.
    • The application remains locked while uploading - no progressbar is possible.
    See Also:
    Serialized Form
    • Constructor Detail

      • GAEVaadinServlet

        public GAEVaadinServlet()
    • Method Detail

      • service

        protected void service​(javax.servlet.http.HttpServletRequest unwrappedRequest,
                               javax.servlet.http.HttpServletResponse unwrappedResponse)
                        throws javax.servlet.ServletException,
                               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.
        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