public class DefaultGroovyPageLocator extends java.lang.Object implements GroovyPageLocator, ResourceLoaderAware, ApplicationContextAware, PluginManagerAware
Used to locate GSPs whether in development or WAR deployed mode from static resources, custom resource loaders and binary plugins.
| Modifiers | Name | Description |
|---|---|---|
static class |
DefaultGroovyPageLocator.PluginViewPathInfo |
| Modifiers | Name | Description |
|---|---|---|
static java.lang.String |
PATH_TO_WEB_INF_VIEWS |
|
protected GrailsPluginManager |
pluginManager |
|
protected boolean |
reloadEnabled |
|
protected java.util.Collection<ResourceLoader> |
resourceLoaders |
|
protected boolean |
warDeployed |
| Type Params | Return Type | Name and description |
|---|---|---|
|
public void |
addResourceLoader(ResourceLoader resourceLoader) |
|
protected GroovyPageCompiledScriptSource |
createGroovyPageCompiledScriptSource(java.lang.String uri, java.lang.String fullPath, java.lang.Class<?> viewClass) |
|
protected GroovyPageScriptSource |
findBinaryScriptSource(java.lang.String uri) |
|
public GroovyPageScriptSource |
findPage(java.lang.String uri) |
|
public GroovyPageScriptSource |
findPageInBinding(java.lang.String pluginName, java.lang.String uri, TemplateVariableBinding binding) |
|
public GroovyPageScriptSource |
findPageInBinding(java.lang.String uri, TemplateVariableBinding binding) |
|
protected Resource |
findReloadablePage(java.lang.String uri) |
|
protected Resource |
findResource(java.lang.String uri) |
|
protected Resource |
findResource(java.util.List<java.lang.String> searchPaths) |
|
protected Resource |
findResourceInPlugins(java.lang.String uri) |
|
protected GroovyPageScriptSource |
findResourceScriptPathForSearchPaths(java.lang.String uri, java.util.List<java.lang.String> searchPaths) |
|
protected GroovyPageScriptSource |
findResourceScriptSource(java.lang.String uri) |
|
protected GroovyPageScriptSource |
findResourceScriptSourceInPlugins(java.lang.String uri) |
|
public static DefaultGroovyPageLocator.PluginViewPathInfo |
getPluginViewPathInfo(java.lang.String uri) |
|
protected boolean |
isDevelopmentMode()Whether the application is being developed, which is decided by whether it looks like a project on disk. |
|
public boolean |
isPrecompiledAvailable()Whether the pages compiled at build time should be used. |
|
public boolean |
isReloadEnabled() |
|
public void |
removePrecompiledPage(GroovyPageCompiledScriptSource scriptSource) |
|
protected java.lang.String |
removePrefix(java.lang.String uri, java.lang.String prefix) |
|
protected java.lang.String |
removeViewLocationPrefixes(java.lang.String uri) |
|
protected java.lang.String |
resolveContextPath(java.lang.String pluginName, java.lang.String uri, TemplateVariableBinding binding) |
|
protected java.lang.String |
resolveContextPath(java.lang.String pluginName, java.lang.String uri, TemplateVariableBinding binding, boolean forceCamelCase) |
|
protected java.lang.String |
resolvePluginViewPath(java.lang.String uri, GrailsPlugin plugin) |
|
protected java.util.List<java.lang.String> |
resolveSearchPaths(java.lang.String uri) |
|
protected GroovyPageScriptSource |
resolveViewInBinaryPlugin(BinaryGrailsPlugin binaryPlugin, java.lang.String uri) |
|
public Resource |
run() |
|
public void |
setApplicationContext(ApplicationContext applicationContext) |
|
public void |
setPluginManager(GrailsPluginManager pluginManager) |
|
public void |
setPrecompiledGspMap(java.util.Map<java.lang.String, java.lang.String> precompiledGspMap) |
|
public void |
setReloadEnabled(boolean reloadEnabled) |
|
public void |
setResourceLoader(ResourceLoader resourceLoader) |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
Whether the application is being developed, which is decided by whether it looks like a project on disk. Overridable because that is derived from the working directory when the class is loaded, and so cannot be varied any other way.
Whether the pages compiled at build time should be used.
They are skipped in development so that editing a page takes effect without a restart, and that is decided by whether the application looks like a project on disk. An ahead-of-time image can look like one -- it is a single executable that may be run from anywhere, including the directory it was built in -- but it cannot compile a page at run time, because it cannot define a class at all. Reading the sources there renders nothing, so the compiled pages are used whatever the surroundings suggest.