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, logger, pluginManager, reloadEnabled, resourceLoaders, warDeployed |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public GroovyPageScriptSource |
findTemplate(String controllerName, String templateName)Finds a template for the given controller name and template name |
|
public GroovyPageScriptSource |
findTemplate(Object controller, String templateName)Finds a template for the given controller name and template name |
|
public GroovyPageScriptSource |
findTemplate(String templateName)Finds a template for the given given template name, looking up the controller from the request as necessary |
|
public GroovyPageScriptSource |
findTemplateByPath(String uri)Find a template for a path. |
|
public GroovyPageScriptSource |
findTemplateInBinding(Object controller, 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(Object controller, String pluginName, 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(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(String pluginName, 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(String controllerName, String viewName) |
|
public GroovyPageScriptSource |
findView(String controllerName, String viewName, String format) |
|
public GroovyPageScriptSource |
findView(Object controller, String viewName) |
|
public GroovyPageScriptSource |
findView(String viewName)Finds a view for the given given view name, looking up the controller from the request as necessary |
|
public GroovyPageScriptSource |
findViewByPath(String uri)Find a view for a path. |
|
public GroovyPageScriptSource |
findViewForFormat(String controllerName, String viewName, String format)Finds a view for the given view name and format, otherwise returns null if it doesn't exist |
|
protected String |
getNameForController(Object controller) |
|
protected String |
lookupRequestFormat() |
|
public String |
resolveViewFormat(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