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

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

    java.lang.Object
      org.codehaus.groovy.grails.web.pages.discovery.DefaultGroovyPageLocator
          org.codehaus.groovy.grails.web.pages.discovery.GrailsConventionGroovyPageLocator

    public class GrailsConventionGroovyPageLocator
    extends DefaultGroovyPageLocator

Extended GroovyPageLocator that deals with the details of Grails' conventions for controllers names, view names and template names

Authors:
  Graeme Rocher

Since:
  2.0

Field Summary

Fields inherited from class DefaultGroovyPageLocator
pluginManager, reloadEnabled, resourceLoaders, warDeployed

Method Summary
`GroovyPageScriptSource` | `findTemplate(java.lang.String controllerName, java.lang.String templateName)` Finds a template for the given controller name and template name
`GroovyPageScriptSource` | `findTemplate(java.lang.Object controller, java.lang.String templateName)` Finds a template for the given controller name and template name
`GroovyPageScriptSource` | `findTemplate(java.lang.String templateName)` Finds a template for the given given template name, looking up the controller from the request as necessary
`GroovyPageScriptSource` | `findTemplateByPath(java.lang.String uri)` Find a template for a path.
`GroovyPageScriptSource` | `findTemplateInBinding(java.lang.String templateName, GroovyPageBinding binding)` Finds a template for the given given template name, looking up the controller from the request as necessary
`GroovyPageScriptSource` | `findTemplateInBinding(java.lang.String pluginName, java.lang.String templateName, GroovyPageBinding binding)` Finds a template for the given given template name, looking up the controller from the request as necessary
`GroovyPageScriptSource` | `findView(java.lang.String controllerName, java.lang.String viewName)`
`GroovyPageScriptSource` | `findView(java.lang.Object controller, java.lang.String viewName)`
`GroovyPageScriptSource` | `findView(java.lang.String viewName)` Finds a view for the given given view name, looking up the controller from the request as necessary
`GroovyPageScriptSource` | `findViewByPath(java.lang.String uri)` Find a view for a path.
`protected java.lang.String` | `getNameForController(java.lang.Object controller)`
`static java.lang.String` | `resolveViewFormat(java.lang.String viewName)`

Methods inherited from class DefaultGroovyPageLocator
addResourceLoader, createGroovyPageCompiledScriptSource, findBinaryScriptSource, findPage, findPageInBinding, findPageInBinding, findReloadablePage, findResource, findResource, findResourceInPlugins, findResourceScriptPathForSearchPaths, findResourceScriptSource, findResourceScriptSourceInPlugins, getPluginViewPathInfo, isReloadEnabled, removePrecompiledPage, removePrefix, removeViewLocationPrefixes, resolveContextPath, resolvePluginViewPath, resolveSearchPaths, resolveViewInBinaryPlugin, setApplicationContext, setPluginManager, setPrecompiledGspMap, setReloadEnabled, setResourceLoader, setServletContext

Methods inherited from class java.lang.Object
java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int), 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()

Method Detail

### findTemplate

    public GroovyPageScriptSource findTemplate(java.lang.String controllerName, java.lang.String templateName)

  Finds a template for the given controller name and template name
  Parameters:
    `controllerName` - The controller name
    `templateName` - The view name
  Returns:
    The GroovyPageScriptSource

### findTemplate

    public GroovyPageScriptSource findTemplate(java.lang.Object controller, java.lang.String templateName)

  Finds a template for the given controller name and template name
  Parameters:
    `controller` - The controller n
    `templateName` - The view name
  Returns:
    The GroovyPageScriptSource

### findTemplate

    public GroovyPageScriptSource findTemplate(java.lang.String templateName)

  Finds a template for the given given template name, looking up the controller from the request as necessary
  Parameters:
    `templateName` - The template name
  Returns:
    The GroovyPageScriptSource

### findTemplateByPath

    public GroovyPageScriptSource findTemplateByPath(java.lang.String uri)

  Find a template for a path. For example /foo/bar will search for /WEB-INF/grails-app/views/foo/_bar.gsp in production and grails-app/views/foo/_bar.gsp at development time
  Parameters:
    `uri` - The uri to search
  Returns:
    The script source

### findTemplateInBinding

    public GroovyPageScriptSource findTemplateInBinding(java.lang.String templateName, GroovyPageBinding binding)

  Finds a template for the given given template name, looking up the controller from the request as necessary
  Parameters:
    `templateName` - The template name
  Returns:
    The GroovyPageScriptSource

### findTemplateInBinding

    public GroovyPageScriptSource findTemplateInBinding(java.lang.String pluginName, java.lang.String templateName, GroovyPageBinding binding)

  Finds a template for the given given template name, looking up the controller from the request as necessary
  Parameters:
    `pluginName` - The plugin
    `templateName` - The template name
    `binding` - The binding
  Returns:
    The GroovyPageScriptSource

### findView

    public GroovyPageScriptSource findView(java.lang.String controllerName, java.lang.String viewName)

  Finds a view for the given controller name and view name. For example specifying a controller name of "home" and a view name of "index" will search for /WEB-INF/grails-app/views/home/index.gsp in production and grails-app/views/home/index.gsp in development

  This method will also detect the presence of the requested response format and try to resolve a more appropriate view. For example in the response format is 'xml' then /WEB-INF/grails-app/views/home/index.xml.gsp will be tried first

  If the view is not found in the application then a scan is executed that searches through binary and source plugins looking for the first matching view name

  Parameters:
    `controllerName` - The controller name
    `viewName` - The view name
  Returns:
    The GroovyPageScriptSource

### findView

    public GroovyPageScriptSource findView(java.lang.Object controller, java.lang.String viewName)

  Finds a view for the given controller and view name. For example specifying a controller with a class name of HomeController and a view name of "index" will search for /WEB-INF/grails-app/views/home/index.gsp in production and grails-app/views/home/index.gsp in development

  If the view is not found in the application then a scan is executed that searches through binary and source plugins looking for the first matching view name

  Parameters:
    `controller` - The controller
    `viewName` - The view name
  Returns:
    The GroovyPageScriptSource

### findView

    public GroovyPageScriptSource findView(java.lang.String viewName)

  Finds a view for the given given view name, looking up the controller from the request as necessary
  Parameters:
    `viewName` - The view name
  Returns:
    The GroovyPageScriptSource

### findViewByPath

    public GroovyPageScriptSource findViewByPath(java.lang.String uri)

  Find a view for a path. For example /foo/bar will search for /WEB-INF/grails-app/views/foo/bar.gsp in production and grails-app/views/foo/bar.gsp at development time
  Parameters:
    `uri` - The uri to search
  Returns:
    The script source

### getNameForController

    protected java.lang.String getNameForController(java.lang.Object controller)

### resolveViewFormat

    public static java.lang.String resolveViewFormat(java.lang.String viewName)

Groovy Documentation