com.vaadin.terminal.gwt.server.


Class ApplicationRunnerServlet

java.lang.Object
  javax.servlet.GenericServlet
      javax.servlet.http.HttpServlet
          com.vaadin.terminal.gwt.server.AbstractApplicationServlet
              com.vaadin.terminal.gwt.server.ApplicationRunnerServlet

All Implemented Interfaces:

Constants, Serializable, Servlet, ServletConfig

public class ApplicationRunnerServlet
extends AbstractApplicationServlet

See Also:

Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.vaadin.terminal.gwt.server.AbstractApplicationServlet
AbstractApplicationServlet.ParameterHandlerErrorImpl, AbstractApplicationServlet.RequestError, AbstractApplicationServlet.RequestType, AbstractApplicationServlet.URIHandlerErrorImpl
 
Field Summary
 
Fields inherited from class com.vaadin.terminal.gwt.server.AbstractApplicationServlet
REQUEST_APPSTYLE, REQUEST_DEFAULT_THEME, REQUEST_FRAGMENT, REQUEST_SHARED_WIDGETSET, REQUEST_VAADIN_STATIC_FILE_PATH, REQUEST_WIDGETSET, VERSION, VERSION_BUILD, VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION
 
Fields inherited from interface com.vaadin.terminal.gwt.server.Constants
AJAX_UIDL_URI, DEFAULT_BUFFER_SIZE, DEFAULT_THEME_CACHETIME, DEFAULT_THEME_NAME, DEFAULT_WIDGETSET, ERROR_NO_WINDOW_FOUND, 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, SERVLET_PARAMETER_DEBUG, SERVLET_PARAMETER_DISABLE_XSRF_PROTECTION, SERVLET_PARAMETER_PRODUCTION_MODE, SERVLET_PARAMETER_RESOURCE_CACHE_TIME, THEME_DIRECTORY_PATH, URL_PARAMETER_CLOSE_APPLICATION, URL_PARAMETER_REPAINT_ALL, URL_PARAMETER_RESTART_APPLICATION, URL_PARAMETER_THEME, WARNING_RESOURCE_CACHING_TIME_NOT_NUMERIC, WARNING_XSRF_PROTECTION_DISABLED, WIDGETSET_DIRECTORY_PATH, WIDGETSET_MISMATCH_INFO
 
Constructor Summary
ApplicationRunnerServlet()
           
 
Method Summary
protected  Class<? extends Application> getApplicationClass()
           
protected  URL getApplicationUrl(HttpServletRequest request)
          Gets the current application URL from request.
protected  Application getNewApplication(HttpServletRequest request)
          Creates a new application for the given request.
protected  String getRequestPathInfo(HttpServletRequest request)
          Returns the path info; note that this _can_ be different than request.getPathInfo().
protected  String getStaticFilesLocation(HttpServletRequest request)
          Return the URL from where static files, e.g.
 void init(ServletConfig servletConfig)
          Called by the servlet container to indicate to a servlet that the servlet is being placed into service.
protected  void service(HttpServletRequest request, HttpServletResponse response)
          Receives standard HTTP requests from the public service method and dispatches them.
 
Methods inherited from class com.vaadin.terminal.gwt.server.AbstractApplicationServlet
createCommunicationManager, createPreventCachingQueryString, criticalNotification, getApplicationContext, getApplicationCSSClassName, getApplicationProperty, getApplicationWindow, getClassLoader, getDefaultTheme, getExistingApplication, getNoScriptMessage, getRequestType, getResourceCacheTime, getResourceLocation, getResourcePath, getSystemMessages, getSystemProperty, handleURI, isAllowedVAADINResourceUrl, isProductionMode, isStandalone, safeEscapeForHtml, setAjaxPageHeaders, stripSpecialChars, writeAjaxPage, writeAjaxPageHtmlBodyStart, writeAjaxPageHtmlHeader, writeAjaxPageHtmlHeadStart, writeAjaxPageHtmlMainDiv, writeAjaxPageHtmlVaadinScripts, 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
destroy, 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

ApplicationRunnerServlet

public ApplicationRunnerServlet()
Method Detail

init

public void init(ServletConfig servletConfig)
          throws ServletException

Description copied from class: AbstractApplicationServlet

Called by the servlet container to indicate to a servlet that the servlet is being placed into service.

Specified by:
init in interface Servlet
Overrides:
init in class AbstractApplicationServlet

Parameters:
servletConfig - the object containing the servlet's configuration and initialization parameters
Throws:
ServletException - if an exception has occurred that interferes with the servlet's normal operation.

service

protected void service(HttpServletRequest request,
                       HttpServletResponse response)
                throws ServletException,
                       IOException

Description copied from class: AbstractApplicationServlet

Receives standard HTTP requests from the public service method and dispatches them.

Overrides:
service in class AbstractApplicationServlet

Parameters:
request - the object that contains the request the client made of the servlet.
response - the object that contains the response the servlet returns to the client.
Throws:
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.

getApplicationUrl

protected URL getApplicationUrl(HttpServletRequest request)
                         throws MalformedURLException

Description copied from class: AbstractApplicationServlet

Gets the current application URL from request.

Overrides:
getApplicationUrl in class AbstractApplicationServlet

Parameters:
request - the HTTP request.
Throws:
MalformedURLException - if the application is denied access to the persistent data store represented by the given URL.

getNewApplication

protected Application getNewApplication(HttpServletRequest request)
                                 throws ServletException

Description copied from class: AbstractApplicationServlet

Creates a new application for the given request.

Specified by:
getNewApplication in class AbstractApplicationServlet

Parameters:
request - the HTTP request.
Returns:
A new Application instance.
Throws:
ServletException

getApplicationClass

protected Class<? extends Application> getApplicationClass()
                                                    throws ClassNotFoundException

Specified by:
getApplicationClass in class AbstractApplicationServlet

Throws:
ClassNotFoundException

getRequestPathInfo

protected String getRequestPathInfo(HttpServletRequest request)

Description copied from class: AbstractApplicationServlet

Returns the path info; note that this _can_ be different than request.getPathInfo(). Examples where this might be useful:

  • An application runner servlet that runs different Vaadin applications based on an identifier.
  • Providing a REST interface in the context root, while serving a Vaadin UI on a sub-URI using only one servlet (e.g. REST on http://example.com/foo, UI on http://example.com/foo/vaadin)
  • Overrides:
    getRequestPathInfo in class AbstractApplicationServlet
    Returns:

getStaticFilesLocation

protected String getStaticFilesLocation(HttpServletRequest request)

Description copied from class: AbstractApplicationServlet

Return the URL from where static files, e.g. the widgetset and the theme, are served. In a standard configuration the VAADIN folder inside the returned folder is what is used for widgetsets and themes. The returned folder is usually the same as the context path and independent of the application.

Overrides:
getStaticFilesLocation in class AbstractApplicationServlet

Returns:
The location of static resources (should contain the VAADIN directory). Never ends with a slash (/).