public class ViewRestSources
extends java.lang.Object
| Constructor and Description |
|---|
ViewRestSources() |
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<java.lang.String,java.lang.String> |
getPrefixes() |
java.lang.String |
getPrimaryPrefix() |
void |
map(java.lang.String prefix)
Register root rest mapping prefix.
|
void |
map(java.lang.String url,
java.lang.String prefix)
Register prefix for exact url path (path-mapped prefixes override root mapping).
|
void |
merge(ViewRestSources prefixes)
Merge configurations (in-app config with global extensions).
|
public void map(java.lang.String prefix)
Registration may be performed only once: overrides are not allowed. Most likely, gsp application will have configured root mapping, so use carefully in extensions.
prefix - view rest mapping prefixpublic void map(java.lang.String url,
java.lang.String prefix)
Internally, path used without first slash to simplify matching.
Only one prefix may be registered per url. In case of overriding registration error will be thrown.
Pay attention that additional asset locations registration may be required, because only templates relative to view class will be correctly resolved, but direct templates may fail to resolve.
url - sub urlprefix - asset classpath locationpublic java.lang.String getPrimaryPrefix()
public java.util.Map<java.lang.String,java.lang.String> getPrefixes()
public void merge(ViewRestSources prefixes)
Will throw error on configuration override attempt (configuration clash).
prefixes - other prefixes configuration