Groovy Documentation

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

    java.lang.Object
      org.springframework.web.servlet.FrameworkServlet
          org.codehaus.groovy.grails.web.pages.GroovyPagesServlet

    public class GroovyPagesServlet
    extends 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: <servlet> GroovyPagesServlet org.codehaus.groovy.grails.web.pages.GroovyPagesServlet showSource 1 <description> Allows developers to view the intermediade source code, when they pass a showSource argument in the URL (eg /edit/list?showSource=true. </description> </servlet>

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

Field Summary
`static java.lang.String` | `EXCEPTION_MODEL_KEY`
`static java.lang.String` | `SERVLET_INSTANCE`

Constructor Summary
`GroovyPagesServlet()`

Method Summary
`protected java.io.Writer` | `createResponseWriter(HttpServletResponse response)` Creates a response writer for the given response object
`protected void` | `doService(HttpServletRequest request, HttpServletResponse response)`
`protected void` | `handleException(HttpServletRequest request, HttpServletResponse response, java.lang.Exception exception, java.io.Writer out, GroovyPagesTemplateEngine engine)` Performs exception handling by attempting to render the Errors view
`protected void` | `initFrameworkServlet()`
`protected void` | `renderPageWithEngine(GroovyPagesTemplateEngine engine, HttpServletRequest request, HttpServletResponse response, groovy.text.Template template)` Attempts to render the page with the given arguments

Field Detail

### EXCEPTION_MODEL_KEY

    public static final java.lang.String EXCEPTION_MODEL_KEY

### SERVLET_INSTANCE

    public static final java.lang.String SERVLET_INSTANCE

Constructor Detail

### GroovyPagesServlet

    public GroovyPagesServlet()

Method Detail

### createResponseWriter

    protected java.io.Writer createResponseWriter(HttpServletResponse response)

  Creates a response writer for the given response object
  Parameters:
    `response` - The HttpServletResponse
  Returns:
    The created java.io.Writer

### doService

    @Override
    protected void doService(HttpServletRequest request, HttpServletResponse response)

### handleException

    protected void handleException(HttpServletRequest request, HttpServletResponse response, java.lang.Exception exception, java.io.Writer out, GroovyPagesTemplateEngine engine)

  Performs exception handling by attempting to render the Errors view
  throws:
    IOException Thrown when an I/O exception occurs rendering the page
  Parameters:
    request
    response
    `exception` - The exception that occured
    `out` - The Writer
    `engine` - The GSP engine

### initFrameworkServlet

    @Override
    protected void initFrameworkServlet()

### renderPageWithEngine

    protected void renderPageWithEngine(GroovyPagesTemplateEngine engine, HttpServletRequest request, HttpServletResponse response, groovy.text.Template template)

  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
    `template` - The template

Groovy Documentation