Package: org.codehaus.groovy.grails.web.pages

## [Java] Class GroovyPagesServlet

- org.codehaus.groovy.grails.web.pages.GroovyPagesServlet

- All Implemented Interfaces and Traits:
    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

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static java.lang.String` | `SERVLET_INSTANCE` | The size of the buffer used when formulating the response

  - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class org.springframework.web.servlet.FrameworkServlet` | `DEFAULT_NAMESPACE_SUFFIX, DEFAULT_CONTEXT_CLASS, SERVLET_CONTEXT_PREFIX`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `GroovyPagesServlet ()`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `protected org.springframework.web.context.request.ServletRequestAttributes` | `buildRequestAttributes(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.web.context.request.RequestAttributes previousAttributes)`
    `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)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class org.springframework.web.servlet.FrameworkServlet` | `org.springframework.web.servlet.FrameworkServlet#destroy(), 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#setContextConfigLocation(java.lang.String), org.springframework.web.servlet.FrameworkServlet#getContextConfigLocation(), org.springframework.web.servlet.FrameworkServlet#setContextInitializers([Lorg.springframework.context.ApplicationContextInitializer;), org.springframework.web.servlet.FrameworkServlet#setContextInitializerClasses(java.lang.String), 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#refresh(), org.springframework.web.servlet.FrameworkServlet#getNamespace(), org.springframework.web.servlet.FrameworkServlet#setNamespace(java.lang.String), org.springframework.web.servlet.FrameworkServlet#getWebApplicationContext(), org.springframework.web.servlet.FrameworkServlet#setApplicationContext(org.springframework.context.ApplicationContext), org.springframework.web.servlet.FrameworkServlet#getContextAttribute(), org.springframework.web.servlet.FrameworkServlet#onApplicationEvent(org.springframework.context.event.ContextRefreshedEvent), org.springframework.web.servlet.FrameworkServlet#init(), org.springframework.web.servlet.FrameworkServlet#getEnvironment(), org.springframework.web.servlet.FrameworkServlet#getEnvironment(), 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#getServletConfig(), org.springframework.web.servlet.FrameworkServlet#getServletInfo(), org.springframework.web.servlet.FrameworkServlet#getInitParameter(java.lang.String), org.springframework.web.servlet.FrameworkServlet#getInitParameterNames(), org.springframework.web.servlet.FrameworkServlet#wait(long, int), org.springframework.web.servlet.FrameworkServlet#wait(long), org.springframework.web.servlet.FrameworkServlet#wait(), 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()`
    `class org.springframework.web.servlet.HttpServletBean` | `org.springframework.web.servlet.HttpServletBean#init(), org.springframework.web.servlet.HttpServletBean#getEnvironment(), org.springframework.web.servlet.HttpServletBean#getEnvironment(), 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#getServletConfig(), org.springframework.web.servlet.HttpServletBean#getServletInfo(), org.springframework.web.servlet.HttpServletBean#getInitParameter(java.lang.String), org.springframework.web.servlet.HttpServletBean#getInitParameterNames(), org.springframework.web.servlet.HttpServletBean#wait(long, int), org.springframework.web.servlet.HttpServletBean#wait(long), org.springframework.web.servlet.HttpServletBean#wait(), 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

    - #### public static final java.lang.String SERVLET_INSTANCE

      The size of the buffer used when formulating the response

  - ### Constructor Detail

    - #### public GroovyPagesServlet()

  - ### Method Detail

    - #### @java.lang.Override protected org.springframework.web.context.request.ServletRequestAttributes buildRequestAttributes(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, org.springframework.web.context.request.RequestAttributes previousAttributes)

    - #### 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

    - #### @java.lang.Override protected void doService(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)

    - #### protected GroovyPageScriptSource findPageInBinaryPlugins(java.lang.String pageName)

    - #### public GroovyPagesTemplateEngine getGroovyPagesTemplateEngine()

    - #### @java.lang.Override 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

      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

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

    - #### public void setGroovyPagesTemplateEngine(GroovyPagesTemplateEngine groovyPagesTemplateEngine)

    - #### public void setPluginManager(GrailsPluginManager pluginManager)