|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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
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 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 |
---|
public GroovyPageScriptSource findTemplate(java.lang.String controllerName, java.lang.String templateName)
controllerName
- The controller nametemplateName
- The view name
public GroovyPageScriptSource findTemplate(java.lang.Object controller, java.lang.String templateName)
controller
- The controller ntemplateName
- The view name
public GroovyPageScriptSource findTemplate(java.lang.String templateName)
templateName
- The template name
public GroovyPageScriptSource findTemplateByPath(java.lang.String uri)
uri
- The uri to search
public GroovyPageScriptSource findTemplateInBinding(java.lang.String templateName, GroovyPageBinding binding)
templateName
- The template name
public GroovyPageScriptSource findTemplateInBinding(java.lang.String pluginName, java.lang.String templateName, GroovyPageBinding binding)
pluginName
- The plugintemplateName
- The template namebinding
- The binding
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
controllerName
- The controller nameviewName
- The view name
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
controller
- The controllerviewName
- The view name
public GroovyPageScriptSource findView(java.lang.String viewName)
viewName
- The view name
public GroovyPageScriptSource findViewByPath(java.lang.String uri)
uri
- The uri to search
protected java.lang.String getNameForController(java.lang.Object controller)
public static java.lang.String resolveViewFormat(java.lang.String viewName)
Groovy Documentation