Groovy Documentation

org.codehaus.groovy.grails.web.pages
[Java] Class GroovyPagesServlet

java.lang.Object
  javax.servlet.GenericServlet
      javax.servlet.http.HttpServlet
          org.springframework.web.servlet.HttpServletBean
              org.springframework.web.servlet.FrameworkServlet
                  org.codehaus.groovy.grails.web.pages.GroovyPagesServlet
All Implemented Interfaces:
PluginManagerAware

public class GroovyPagesServlet
extends org.springframework.web.servlet.FrameworkServlet

NOTE: Based on work done by on the GSP standalone project (https://gsp.dev.java.net/) Main servlet class. Example usage in web.xml: GroovyPagesServlet org.codehaus.groovy.grails.web.pages.GroovyPagesServlet showSource 1 Allows developers to view the intermediade source code, when they pass a showSource argument in the URL (eg /edit/list?showSource=true.

Authors:
Troy Heninger
Graeme Rocher Date: Jan 10, 2004


Field Summary
static java.lang.String SERVLET_INSTANCE

The size of the buffer used when formulating the response

 
Fields inherited from class org.springframework.web.servlet.FrameworkServlet
DEFAULT_NAMESPACE_SUFFIX, DEFAULT_CONTEXT_CLASS, SERVLET_CONTEXT_PREFIX
 
Constructor Summary
GroovyPagesServlet()

 
Method Summary
protected GSPResponseWriter createResponseWriter(javax.servlet.http.HttpServletResponse response)

Creates a response writer for the given response object

protected void doService(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)

protected GroovyPageScriptSource findPageInBinaryPlugins(java.lang.String pageName)

GroovyPagesTemplateEngine getGroovyPagesTemplateEngine()

protected void initFrameworkServlet()

protected boolean isSecurePath(java.lang.String pageName)

protected void renderPageWithEngine(GroovyPagesTemplateEngine engine, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, GroovyPageScriptSource scriptSource)

Attempts to render the page with the given arguments

protected void sendNotFound(javax.servlet.http.HttpServletResponse response, java.lang.String pageName)

void setGroovyPagesTemplateEngine(GroovyPagesTemplateEngine groovyPagesTemplateEngine)

void setPluginManager(GrailsPluginManager pluginManager)

 
Methods inherited from class org.springframework.web.servlet.FrameworkServlet
org.springframework.web.servlet.FrameworkServlet#getNamespace(), org.springframework.web.servlet.FrameworkServlet#destroy(), org.springframework.web.servlet.FrameworkServlet#refresh(), org.springframework.web.servlet.FrameworkServlet#setNamespace(java.lang.String), org.springframework.web.servlet.FrameworkServlet#getContextAttribute(), org.springframework.web.servlet.FrameworkServlet#onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent), org.springframework.web.servlet.FrameworkServlet#getWebApplicationContext(), org.springframework.web.servlet.FrameworkServlet#setContextAttribute(java.lang.String), org.springframework.web.servlet.FrameworkServlet#setContextClass(java.lang.Class), org.springframework.web.servlet.FrameworkServlet#getContextClass(), org.springframework.web.servlet.FrameworkServlet#setContextId(java.lang.String), org.springframework.web.servlet.FrameworkServlet#getContextId(), org.springframework.web.servlet.FrameworkServlet#setContextInitializerClasses(java.lang.String), org.springframework.web.servlet.FrameworkServlet#setContextInitializers([Lorg.springframework.context.ApplicationContextInitializer;), org.springframework.web.servlet.FrameworkServlet#setContextConfigLocation(java.lang.String), org.springframework.web.servlet.FrameworkServlet#getContextConfigLocation(), org.springframework.web.servlet.FrameworkServlet#setPublishContext(boolean), org.springframework.web.servlet.FrameworkServlet#setPublishEvents(boolean), org.springframework.web.servlet.FrameworkServlet#setThreadContextInheritable(boolean), org.springframework.web.servlet.FrameworkServlet#setDispatchOptionsRequest(boolean), org.springframework.web.servlet.FrameworkServlet#setDispatchTraceRequest(boolean), org.springframework.web.servlet.FrameworkServlet#getServletContextAttributeName(), org.springframework.web.servlet.FrameworkServlet#init(), org.springframework.web.servlet.FrameworkServlet#setEnvironment(org.springframework.core.env.Environment), org.springframework.web.servlet.FrameworkServlet#getServletContext(), org.springframework.web.servlet.FrameworkServlet#getServletName(), org.springframework.web.servlet.FrameworkServlet#service(javax.servlet.ServletRequest, javax.servlet.ServletResponse), org.springframework.web.servlet.FrameworkServlet#log(java.lang.String, java.lang.Throwable), org.springframework.web.servlet.FrameworkServlet#log(java.lang.String), org.springframework.web.servlet.FrameworkServlet#init(javax.servlet.ServletConfig), org.springframework.web.servlet.FrameworkServlet#getInitParameter(java.lang.String), org.springframework.web.servlet.FrameworkServlet#getServletConfig(), org.springframework.web.servlet.FrameworkServlet#getServletInfo(), org.springframework.web.servlet.FrameworkServlet#getInitParameterNames(), org.springframework.web.servlet.FrameworkServlet#wait(), org.springframework.web.servlet.FrameworkServlet#wait(long, int), org.springframework.web.servlet.FrameworkServlet#wait(long), org.springframework.web.servlet.FrameworkServlet#equals(java.lang.Object), org.springframework.web.servlet.FrameworkServlet#toString(), org.springframework.web.servlet.FrameworkServlet#hashCode(), org.springframework.web.servlet.FrameworkServlet#getClass(), org.springframework.web.servlet.FrameworkServlet#notify(), org.springframework.web.servlet.FrameworkServlet#notifyAll()
 
Methods inherited from class org.springframework.web.servlet.HttpServletBean
org.springframework.web.servlet.HttpServletBean#init(), org.springframework.web.servlet.HttpServletBean#setEnvironment(org.springframework.core.env.Environment), org.springframework.web.servlet.HttpServletBean#getServletContext(), org.springframework.web.servlet.HttpServletBean#getServletName(), org.springframework.web.servlet.HttpServletBean#service(javax.servlet.ServletRequest, javax.servlet.ServletResponse), org.springframework.web.servlet.HttpServletBean#log(java.lang.String, java.lang.Throwable), org.springframework.web.servlet.HttpServletBean#log(java.lang.String), org.springframework.web.servlet.HttpServletBean#init(javax.servlet.ServletConfig), org.springframework.web.servlet.HttpServletBean#destroy(), org.springframework.web.servlet.HttpServletBean#getInitParameter(java.lang.String), org.springframework.web.servlet.HttpServletBean#getServletConfig(), org.springframework.web.servlet.HttpServletBean#getServletInfo(), org.springframework.web.servlet.HttpServletBean#getInitParameterNames(), org.springframework.web.servlet.HttpServletBean#wait(), org.springframework.web.servlet.HttpServletBean#wait(long, int), org.springframework.web.servlet.HttpServletBean#wait(long), org.springframework.web.servlet.HttpServletBean#equals(java.lang.Object), org.springframework.web.servlet.HttpServletBean#toString(), org.springframework.web.servlet.HttpServletBean#hashCode(), org.springframework.web.servlet.HttpServletBean#getClass(), org.springframework.web.servlet.HttpServletBean#notify(), org.springframework.web.servlet.HttpServletBean#notifyAll()
 

Field Detail

SERVLET_INSTANCE

public static final java.lang.String SERVLET_INSTANCE
The size of the buffer used when formulating the response


 
Constructor Detail

GroovyPagesServlet

public GroovyPagesServlet()


 
Method Detail

createResponseWriter

protected GSPResponseWriter createResponseWriter(javax.servlet.http.HttpServletResponse response)
Creates a response writer for the given response object
Parameters:
response - The HttpServletResponse
Returns:
The created java.io.Writer


doService

protected void doService(HttpServletRequest request, HttpServletResponse response) throws Exception {
protected void doService(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)


findPageInBinaryPlugins

protected GroovyPageScriptSource findPageInBinaryPlugins(java.lang.String pageName)


getGroovyPagesTemplateEngine

public GroovyPagesTemplateEngine getGroovyPagesTemplateEngine()


initFrameworkServlet

protected void initFrameworkServlet() throws ServletException, BeansException {
protected void initFrameworkServlet()


isSecurePath

protected boolean isSecurePath(java.lang.String pageName)


renderPageWithEngine

protected void renderPageWithEngine(GroovyPagesTemplateEngine engine, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, GroovyPageScriptSource scriptSource)
Attempts to render the page with the given arguments
throws:
IOException Thrown when an I/O exception occurs rendering the page
Parameters:
engine - The GroovyPagesTemplateEngine to use
request - The HttpServletRequest
response - The HttpServletResponse
scriptSource - The template


sendNotFound

protected void sendNotFound(javax.servlet.http.HttpServletResponse response, java.lang.String pageName)


setGroovyPagesTemplateEngine

public void setGroovyPagesTemplateEngine(GroovyPagesTemplateEngine groovyPagesTemplateEngine)


setPluginManager

public void setPluginManager(GrailsPluginManager pluginManager)


 

Groovy Documentation