|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
com.vaadin.terminal.gwt.server.AbstractApplicationServlet
public abstract class AbstractApplicationServlet
Abstract implementation of the ApplicationServlet which handles all communication between the client and the server. It is possible to extend this class to provide own functionality but in most cases this is unnecessary.
| Nested Class Summary | |
|---|---|
class |
AbstractApplicationServlet.RequestError
|
protected static class |
AbstractApplicationServlet.RequestType
|
| Field Summary | |
|---|---|
static String |
VERSION
The version number of this release. |
static String |
VERSION_BUILD
Build identifier. |
static int |
VERSION_MAJOR
Major version number. |
static int |
VERSION_MINOR
Minor version number. |
static int |
VERSION_REVISION
Version revision number. |
| Constructor Summary | |
|---|---|
AbstractApplicationServlet()
|
|
| Method Summary | |
|---|---|
CommunicationManager |
createCommunicationManager(Application application)
Deprecated. Instead of overriding this method, override WebApplicationContext implementation via
getApplicationContext(HttpSession)
method and in that customized implementation return your
CommunicationManager in
WebApplicationContext.getApplicationManager(Application, AbstractApplicationServlet)
method. |
protected WrappedHttpServletRequest |
createWrappedRequest(HttpServletRequest request)
Create a wrapped request for a http servlet request. |
protected void |
criticalNotification(HttpServletRequest request,
HttpServletResponse response,
String caption,
String message,
String details,
String url)
Send a notification to client's application. |
protected abstract Class<? extends Application> |
getApplicationClass()
|
protected WebApplicationContext |
getApplicationContext(HttpSession session)
Gets the application context from an HttpSession. |
protected String |
getApplicationProperty(String parameterName)
Gets an application property value. |
protected URL |
getApplicationUrl(HttpServletRequest request)
Gets the current application URL from request. |
protected ClassLoader |
getClassLoader()
|
static String |
getDefaultTheme()
Returns the default theme. |
protected DeploymentConfiguration |
getDeploymentConfiguration()
Gets a the deployment configuration for this servlet. |
protected Application |
getExistingApplication(HttpServletRequest request,
boolean allowSessionCreation)
Gets the existing application for given request. |
protected abstract 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 AbstractApplicationServlet.RequestType |
getRequestType(HttpServletRequest request)
|
int |
getResourceCacheTime()
Returns the amount of milliseconds the browser should cache a file. |
String |
getResourceLocation(String theme,
ThemeResource resource)
Gets relative location of a theme resource. |
protected static String |
getResourcePath(ServletContext servletContext,
String path)
Gets resource path using different implementations. |
protected String |
getStaticFilesLocation(HttpServletRequest request)
Return the URL from where static files, e.g. |
protected Application.SystemMessages |
getSystemMessages()
Get system messages from the current application class |
static Application.SystemMessages |
getSystemMessages(Class<? extends Application> appCls)
|
protected String |
getSystemProperty(String parameterName)
Gets an system property value. |
void |
init(ServletConfig servletConfig)
Called by the servlet container to indicate to a servlet that the servlet is being placed into service. |
protected boolean |
isAllowedVAADINResourceUrl(HttpServletRequest request,
URL resourceUrl)
Check whether a URL obtained from a classloader refers to a valid static resource in the directory VAADIN. |
boolean |
isProductionMode()
Returns true if the servlet is running in production mode. |
static String |
safeEscapeForHtml(String unsafe)
Escapes characters to html entities. |
protected void |
service(HttpServletRequest request,
HttpServletResponse response)
Receives standard HTTP requests from the public service method and dispatches them. |
protected static String |
stripSpecialChars(String themeName)
A helper method to strip away characters that might somehow be used for XSS attacs. |
| 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 |
| Field Detail |
|---|
public static final String VERSION
public static final int VERSION_MAJOR
public static final int VERSION_MINOR
public static final int VERSION_REVISION
public static final String VERSION_BUILD
| Constructor Detail |
|---|
public AbstractApplicationServlet()
| Method Detail |
|---|
public void init(ServletConfig servletConfig)
throws ServletException
init in interface Servletinit in class GenericServletservletConfig - the object containing the servlet's configuration and
initialization parameters
ServletException - if an exception has occurred that interferes with the
servlet's normal operation.protected String getApplicationProperty(String parameterName)
parameterName - the Name or the parameter.
protected String getSystemProperty(String parameterName)
parameterName - the Name or the parameter.
public boolean isProductionMode()
public int getResourceCacheTime()
protected void service(HttpServletRequest request,
HttpServletResponse response)
throws ServletException,
IOException
service in class HttpServletrequest - 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.
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.protected WrappedHttpServletRequest createWrappedRequest(HttpServletRequest request)
request - the original http servlet request
protected DeploymentConfiguration getDeploymentConfiguration()
protected ClassLoader getClassLoader()
throws ServletException
ServletException
protected void criticalNotification(HttpServletRequest request,
HttpServletResponse response,
String caption,
String message,
String details,
String url)
throws IOException
request - the HTTP request instance.response - the HTTP response to write to.caption - the notification captionmessage - to notification bodydetails - a detail message to show in addition to the message. Currently
shown directly below the message but could be hidden behind a
details drop down in the future. Mainly used to give
additional information not necessarily useful to the end user.url - url to load when the message is dismissed. Null will reload
the current page.
IOException - if the writing failed due to input/output error.
protected static String getResourcePath(ServletContext servletContext,
String path)
servletContext - path - the resource path.
protected static String stripSpecialChars(String themeName)
themeName -
public static String getDefaultTheme()
protected abstract Application getNewApplication(HttpServletRequest request)
throws ServletException
request - the HTTP request.
ServletException
protected boolean isAllowedVAADINResourceUrl(HttpServletRequest request,
URL resourceUrl)
request - resourceUrl -
protected AbstractApplicationServlet.RequestType getRequestType(HttpServletRequest request)
protected Application.SystemMessages getSystemMessages()
public static Application.SystemMessages getSystemMessages(Class<? extends Application> appCls)
protected abstract Class<? extends Application> getApplicationClass()
throws ClassNotFoundException
ClassNotFoundExceptionprotected String getStaticFilesLocation(HttpServletRequest request)
request -
protected URL getApplicationUrl(HttpServletRequest request)
throws MalformedURLException
request - the HTTP request.
MalformedURLException - if the application is denied access to the persistent data
store represented by the given URL.
protected Application getExistingApplication(HttpServletRequest request,
boolean allowSessionCreation)
throws MalformedURLException,
SessionExpiredException
request - the HTTP request.allowSessionCreation - true if a session should be created if no session exists,
false if no session should be created
MalformedURLException - if the application is denied access to the persistent data
store represented by the given URL.
IllegalAccessException
InstantiationException
SessionExpiredExceptionprotected String getRequestPathInfo(HttpServletRequest request)
request -
public String getResourceLocation(String theme,
ThemeResource resource)
theme - the Theme name.resource - the Theme resource.
protected WebApplicationContext getApplicationContext(HttpSession session)
session - the HTTP session.
@Deprecated public CommunicationManager createCommunicationManager(Application application)
WebApplicationContext implementation via
getApplicationContext(HttpSession)
method and in that customized implementation return your
CommunicationManager in
WebApplicationContext.getApplicationManager(Application, AbstractApplicationServlet)
method.
application -
public static final String safeEscapeForHtml(String unsafe)
unsafe -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||