Package com.vaadin.server
Class GAEVaadinServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- com.vaadin.server.VaadinServlet
-
- com.vaadin.server.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
-
-
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, CANNOT_ACQUIRE_CLASSLOADER_SEVERE, 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, PORTLET_CONTEXT, 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_DESIGN_PREFIX, SERVLET_PARAMETER_LEGACY_PROPERTY_TOSTRING, SERVLET_PARAMETER_PRODUCTION_MODE, SERVLET_PARAMETER_PUSH_MODE, SERVLET_PARAMETER_PUSH_SUSPEND_TIMEOUT_LONGPOLLING, SERVLET_PARAMETER_RESOURCE_CACHE_TIME, SERVLET_PARAMETER_SENDURLSASPARAMETERS, SERVLET_PARAMETER_SYNC_ID_CHECK, 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
Constructors Constructor Description GAEVaadinServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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
allowServePrecompressedResource, createDeploymentConfiguration, createServletService, createVaadinRequest, criticalNotification, destroy, findResourceURL, getApplicationUrl, getCacheTime, getCurrent, getDefaultTheme, getLastPathParameter, getRequestType, getResourcePath, getService, handleContextRootWithoutSlash, init, isAllowedVAADINResourceUrl, isStaticResourceRequest, safeEscapeForHtml, serveStaticResources, serveStaticResourcesInVAADIN, servletInitialized, stripSpecialChars, writeStaticResourceResponse
-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
-
-
-
-
Method Detail
-
sendDeadlineExceededNotification
protected void sendDeadlineExceededNotification(VaadinServletRequest request, VaadinServletResponse response) throws IOException
- Throws:
IOException
-
sendNotSerializableNotification
protected void sendNotSerializableNotification(VaadinServletRequest request, VaadinServletResponse response) throws IOException
- Throws:
IOException
-
sendCriticalErrorNotification
protected void sendCriticalErrorNotification(VaadinServletRequest request, VaadinServletResponse response) throws IOException
- Throws:
IOException
-
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 classVaadinServlet
- 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
-
-