public class GrailsConventionGroovyPageLocator extends DefaultGroovyPageLocator implements GrailsApplicationAware
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 |
PATH_TO_WEB_INF_VIEWS, pluginManager, reloadEnabled, resourceLoaders, warDeployed |
Type Params | Return Type | Name and description |
---|---|---|
|
public GroovyPageScriptSource |
findTemplate(java.lang.String controllerName, java.lang.String templateName) Finds a template for the given controller name and template name |
|
public GroovyPageScriptSource |
findTemplate(java.lang.Object controller, java.lang.String templateName) Finds a template for the given controller name and template name |
|
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 |
|
public GroovyPageScriptSource |
findTemplateByPath(java.lang.String uri) Find a template for a path. |
|
public GroovyPageScriptSource |
findTemplateInBinding(java.lang.Object controller, java.lang.String templateName, TemplateVariableBinding binding) Finds a template for the given given template name, looking up the controller from the request as necessary |
|
public GroovyPageScriptSource |
findTemplateInBinding(java.lang.Object controller, java.lang.String pluginName, java.lang.String templateName, TemplateVariableBinding binding) Finds a template for the given given template name, looking up the controller from the request as necessary |
|
public GroovyPageScriptSource |
findTemplateInBinding(java.lang.String templateName, TemplateVariableBinding binding) Finds a template for the given given template name, looking up the controller from the request as necessary |
|
public GroovyPageScriptSource |
findTemplateInBinding(java.lang.String pluginName, java.lang.String templateName, TemplateVariableBinding binding) Finds a template for the given given template name, looking up the controller from the request as necessary |
|
public GroovyPageScriptSource |
findView(java.lang.String controllerName, java.lang.String viewName) |
|
public GroovyPageScriptSource |
findView(java.lang.String controllerName, java.lang.String viewName, java.lang.String format) |
|
public GroovyPageScriptSource |
findView(java.lang.Object controller, java.lang.String viewName) |
|
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 |
|
public GroovyPageScriptSource |
findViewByPath(java.lang.String uri) Find a view for a path. |
|
public 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() |
|
public java.lang.String |
resolveViewFormat(java.lang.String viewName) |
|
public void |
setGrailsApplication(GrailsApplication grailsApplication) |
|
public void |
setMimeTypeResolver(MimeTypeResolver mimeTypeResolver) |
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 bindingFinds 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