Groovy Documentation

com.vaadin.grails.terminal.gwt.server
[Java] Class GrailsAwareApplicationServlet

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

@SuppressWarnings("serial")
public class GrailsAwareApplicationServlet
extends AbstractApplicationServlet

Authors:
Les Hazlewood
Daniel Bell
Francis McKenzie


Field Summary
static String VAADIN_APPLICATION_BEAN_NAME

private String applicationClassName

Name of the class that extends com.vaadin.Application.

private static org.slf4j.Logger log

 
Fields inherited from class AbstractApplicationServlet
VERSION, VERSION_MAJOR, VERSION_MINOR, VERSION_REVISION, VERSION_BUILD, REQUEST_FRAGMENT, REQUEST_VAADIN_STATIC_FILE_PATH, REQUEST_WIDGETSET, REQUEST_SHARED_WIDGETSET, REQUEST_DEFAULT_THEME, REQUEST_APPSTYLE, NOT_PRODUCTION_MODE_INFO, WARNING_XSRF_PROTECTION_DISABLED, WARNING_RESOURCE_CACHING_TIME_NOT_NUMERIC, WIDGETSET_MISMATCH_INFO, URL_PARAMETER_RESTART_APPLICATION, URL_PARAMETER_CLOSE_APPLICATION, URL_PARAMETER_REPAINT_ALL, URL_PARAMETER_THEME, SERVLET_PARAMETER_DEBUG, SERVLET_PARAMETER_PRODUCTION_MODE, SERVLET_PARAMETER_DISABLE_XSRF_PROTECTION, SERVLET_PARAMETER_RESOURCE_CACHE_TIME, PARAMETER_VAADIN_RESOURCES, DEFAULT_BUFFER_SIZE, MAX_BUFFER_SIZE, AJAX_UIDL_URI, THEME_DIRECTORY_PATH, DEFAULT_THEME_CACHETIME, WIDGETSET_DIRECTORY_PATH, DEFAULT_WIDGETSET, PARAMETER_WIDGETSET, ERROR_NO_WINDOW_FOUND, DEFAULT_THEME_NAME, INVALID_SECURITY_KEY_MSG, PORTAL_PARAMETER_VAADIN_WIDGETSET, PORTAL_PARAMETER_VAADIN_RESOURCE_PATH, PORTAL_PARAMETER_VAADIN_THEME
 
Constructor Summary
GrailsAwareApplicationServlet()

 
Method Summary
private ClassLoader doGetClassLoader()

protected Class getApplicationClass()

protected ClassLoader getClassLoader()

Returns the Grails ClassLoader, because the servlet's ClassLoader can't see the Grails application source.

org.codehaus.groovy.grails.commons.GrailsApplication getGrailsApplication()

protected Application getNewApplication(HttpServletRequest request)

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 httpReq, HttpServletResponse response)

protected void writeAjaxPageHtmlVaadinScripts(Window window, String themeName, Application application, java.io.BufferedWriter out, String appUrl, String themeUri, String appId, HttpServletRequest request)

Adds the JavaScript libraries configured in VaadinConfig to the head of the HTML page.

 
Methods inherited from class AbstractApplicationServlet
init, safeEscapeForHtml, getDefaultTheme, isProductionMode, getResourceCacheTime, getResourceLocation, createCommunicationManager, service, log, log, init, destroy, getServletContext, getServletName, getInitParameter, getInitParameterNames, getServletConfig, getServletInfo, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 
Methods inherited from class HttpServlet
service, log, log, init, init, destroy, getServletContext, getServletName, getInitParameter, getInitParameterNames, getServletConfig, getServletInfo, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Field Detail

VAADIN_APPLICATION_BEAN_NAME

public static final String VAADIN_APPLICATION_BEAN_NAME


applicationClassName

private String applicationClassName
Name of the class that extends com.vaadin.Application. We don't retain the actual Class instance directly due to Grails class reloading - the Application class or any that it references could be reloaded dynamically at runtime during development, so we look up the class with this name from the classloader every time it is requested when creating a new Application instance.


log

private static final org.slf4j.Logger log


 
Constructor Detail

GrailsAwareApplicationServlet

GrailsAwareApplicationServlet()


 
Method Detail

doGetClassLoader

private ClassLoader doGetClassLoader()


getApplicationClass

@Override
@SuppressWarnings({ "unchecked" })
protected Class getApplicationClass()


getClassLoader

@Override
protected ClassLoader getClassLoader()
Returns the Grails ClassLoader, because the servlet's ClassLoader can't see the Grails application source.
throws:
ServletException
Returns:
the ClassLoader stored in the org.codehaus.groovy.grails.commons.GrailsApplication


getGrailsApplication

public org.codehaus.groovy.grails.commons.GrailsApplication getGrailsApplication()


getNewApplication

@Override
protected Application getNewApplication(HttpServletRequest request)


init

@SuppressWarnings("unchecked")
@Override
public void init(ServletConfig servletConfig)
Called by the servlet container to indicate to a servlet that the servlet is being placed into service.

This implementation caches the application class name (not the class itself) to use to acquire the Application class from the Grails classloader at runtime.

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


service

@Override
protected void service(HttpServletRequest httpReq, HttpServletResponse response)


writeAjaxPageHtmlVaadinScripts

@Override
protected void writeAjaxPageHtmlVaadinScripts(Window window, String themeName, Application application, java.io.BufferedWriter out, String appUrl, String themeUri, String appId, HttpServletRequest request)
Adds the JavaScript libraries configured in VaadinConfig to the head of the HTML page.


 

Groovy Documentation