Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD

## grails.gsp
[Groovy] Class PageRenderer

    java.lang.Object
      grails.gsp.PageRenderer

All Implemented Interfaces:
  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
`static class` | `PageRenderer.PageRenderRequestCreator`
`static class` | `PageRenderer.PageRenderResponseCreator`

Property Summary
`org.springframework.context.ApplicationContext` | `applicationContext`
`GrailsConventionGroovyPageLocator` | `groovyPageLocator`
`javax.servlet.ServletContext` | `servletContext`

Constructor Summary
`PageRenderer(GroovyPagesTemplateEngine templateEngine)`

Method Summary
`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

Methods inherited from 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

### applicationContext

    org.springframework.context.ApplicationContext applicationContext

### groovyPageLocator

    GrailsConventionGroovyPageLocator groovyPageLocator

### servletContext

    javax.servlet.ServletContext servletContext

Constructor Detail

### PageRenderer

    PageRenderer(GroovyPagesTemplateEngine templateEngine)

Method Detail

### findResource

    protected GroovyPageScriptSource findResource(java.lang.String basePath)

### render

    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

### renderTo

    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

### renderTo

    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

Groovy Documentation