PageRenderer (Grails 3.2.7)
Date: 2017-03-06

Package: grails.gsp

## [Groovy] Class PageRenderer

- grails.gsp.PageRenderer

- All Implemented Interfaces and Traits:
    org.springframework.context.ApplicationContextAware, org.springframework.web.context.ServletContextAware

      class PageRenderer
      extends java.lang.Object

  Simplified API for rendering GSP pages from services, jobs and other non-request classes.

  Authors:
    Graeme Rocher
  Since:
    2.0

- - ### Nested Class Summary

    Nested classes
    Modifiers | Name | Description
    --- | --- | ---
    `static class` | `PageRenderer.PageRenderRequestCreator` |
    `static class` | `PageRenderer.PageRenderResponseCreator` |

  - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `org.springframework.context.ApplicationContext` | `applicationContext`
    `GrailsConventionGroovyPageLocator` | `groovyPageLocator`
    `java.util.Locale` | `locale`
    `javax.servlet.ServletContext` | `servletContext`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `PageRenderer (GroovyPagesTemplateEngine templateEngine)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `protected GroovyPageScriptSource` | `findResource(java.lang.String basePath)`
    `java.lang.String` | `render(java.util.Map args)` Renders a page and returns the contents
    `void` | `renderTo(java.util.Map args, java.io.Writer writer)` Renders a page and returns the contents
    `void` | `renderTo(java.util.Map args, java.io.OutputStream stream)` Renders a page and returns the contents

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Property Detail

    - #### org.springframework.context.ApplicationContext applicationContext

    - #### GrailsConventionGroovyPageLocator groovyPageLocator

    - #### java.util.Locale locale

    - #### javax.servlet.ServletContext servletContext

  - ### Constructor Detail

    - #### PageRenderer(GroovyPagesTemplateEngine templateEngine)

  - ### Method Detail

    - #### protected GroovyPageScriptSource findResource(java.lang.String basePath)

    - #### java.lang.String render(java.util.Map args)

      Renders a page and returns the contents

      arg:
        view The view to render. Must be an absolute view path since the controller name is unknown.
      arg:
        template The template to render. Must be an absolute template path since the controller name is unknown.
      arg:
        model The model to use for rendering
      Parameters:
        `args` - The named arguments
      Returns:
        The resulting string contents

    - #### void renderTo(java.util.Map args, java.io.Writer writer)

      Renders a page and returns the contents

      arg:
        view The view to render. Must be an absolute view path since the controller name is unknown.
      arg:
        template The template to render. Must be an absolute template path since the controller name is unknown.
      arg:
        model The model to use for rendering
      Parameters:
        `args` - The named arguments
        `writer` - The target writer
      Returns:
        The resulting string contents

    - #### void renderTo(java.util.Map args, java.io.OutputStream stream)

      Renders a page and returns the contents

      arg:
        view The view to render. Must be an absolute view path since the controller name is unknown.
      arg:
        template The template to render. Must be an absolute template path since the controller name is unknown.
      arg:
        model The model to use for rendering
      Parameters:
        `args` - The named arguments
        `stream` - The target stream
      Returns:
        The resulting string contents