public class GrailsConventionGroovyPageLocator extends DefaultGroovyPageLocator
Extended GroovyPageLocator that deals with the details of Grails' conventions for controllers names, view names and template names
Fields inherited from class | Fields |
---|---|
class DefaultGroovyPageLocator |
pluginManager, reloadEnabled, resourceLoaders, warDeployed |
Type Params | Return Type | Name and description |
---|---|---|
|
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.String controllerName, java.lang.String viewName, java.lang.String format) |
|
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. |
|
GroovyPageScriptSource |
findViewForFormat(java.lang.String controllerName, java.lang.String viewName, java.lang.String format) Finds a view for the given view name and format, otherwise returns null if it doesn't exist |
|
protected java.lang.String |
getNameForController(java.lang.Object controller) |
|
protected java.lang.String |
lookupRequestFormat() |
|
java.lang.String |
resolveViewFormat(java.lang.String viewName) |
|
void |
setGrailsApplication(GrailsApplication grailsApplication) |
|
void |
setMimeTypeResolver(MimeTypeResolver mimeTypeResolver) |
Methods inherited from class | Name |
---|---|
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 |
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() |
Finds a template for the given controller name and template name
controllerName
- The controller nametemplateName
- The view nameFinds a template for the given controller name and template name
controller
- The controller ntemplateName
- The view nameFinds a template for the given given template name, looking up the controller from the request as necessary
templateName
- The template nameFind 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
uri
- The uri to searchFinds a template for the given given template name, looking up the controller from the request as necessary
templateName
- The template nameFinds a template for the given given template name, looking up the controller from the request as necessary
pluginName
- The plugintemplateName
- The template namebinding
- The binding
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
controllerName
- The controller nameviewName
- The view name
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
controller
- The controllerviewName
- The view nameFinds a view for the given given view name, looking up the controller from the request as necessary
viewName
- The view nameFind 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
uri
- The uri to searchFinds a view for the given view name and format, otherwise returns null if it doesn't exist
controllerName
- The controller nameviewName
- The view nameformat
- The format