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:
- extends AbstractApplicationServlet
public class ApplicationRunnerServlet
See Also:
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 |
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 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
- Specified by:
init
in interfaceServlet
- Overrides:
init
in classAbstractApplicationServlet
- 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.
Description copied from class: AbstractApplicationServlet
Called by the servlet container to indicate to a servlet that the servlet is being placed into service.
service
protected void service(HttpServletRequest request,
HttpServletResponse response)
throws ServletException,
IOException
- Overrides:
service
in classAbstractApplicationServlet
- 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.
Description copied from class: AbstractApplicationServlet
Receives standard HTTP requests from the public service method and dispatches them.
getApplicationUrl
protected URL getApplicationUrl(HttpServletRequest request)
throws MalformedURLException
- Overrides:
getApplicationUrl
in classAbstractApplicationServlet
- Parameters:
request
- the HTTP request.- Throws:
MalformedURLException
- if the application is denied access to the persistent data store represented by the given URL.
Description copied from class: AbstractApplicationServlet
Gets the current application URL from request.
getNewApplication
protected Application getNewApplication(HttpServletRequest request)
throws ServletException
- Specified by:
getNewApplication
in classAbstractApplicationServlet
- Parameters:
request
- the HTTP request.- Returns:
- A new Application instance.
- Throws:
ServletException
Description copied from class: AbstractApplicationServlet
Creates a new application for the given request.
getApplicationClass
protected Class<? extends Application> getApplicationClass()
throws ClassNotFoundException
- Specified by:
getApplicationClass
in classAbstractApplicationServlet
- Throws:
ClassNotFoundException
getRequestPathInfo
protected String getRequestPathInfo(HttpServletRequest request)
- 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 classAbstractApplicationServlet
- Returns:
Description copied from class: AbstractApplicationServlet
Returns the path info; note that this _can_ be different than request.getPathInfo(). Examples where this might be useful:
getStaticFilesLocation
protected String getStaticFilesLocation(HttpServletRequest request)
- Overrides:
getStaticFilesLocation
in classAbstractApplicationServlet
- Returns:
- The location of static resources (should contain the VAADIN directory). Never ends with a slash (/).
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.