Class ViewRestLookup
java.lang.Object
ru.vyarus.guicey.gsp.app.rest.mapping.ViewRestLookup
View rest endpoints are mapped with a prefix: so gsp application call /something could be remapped to
[rest]/[prefix]/something. Special prefixes could be mapped to some urls: e.g. /sub/url -> prefix2 and so
when /sub/url/something will be called in gsp application it would redirect to [rest]/[prefix2]/something.
- Since:
- 02.12.2019
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuildRestPath(String subContext, String path) lookupRestPrefix(String context) lookupSubContext(String path) Lookup target rest context (rest prefix may be registered to sub url).
-
Constructor Details
-
ViewRestLookup
-
-
Method Details
-
getPrimaryMapping
- Returns:
- main mapping prefix
-
getPrefixes
- Returns:
- configured view rest prefixes
-
lookupSubContext
Lookup target rest context (rest prefix may be registered to sub url). Will select rest prefix context either by sub-url mapping (if url starts with registered sub url) or using root (main) prefix.Knowing sub context is important for templates lookup because in case of detected sub context, rest would be "redirected" under this context, but assets must be resolved with a full path (including this context).
- Parameters:
path- gsp application called url (relative to application mapping root)- Returns:
- target sub context or empty for root context
-
lookupRestPrefix
- Parameters:
context- context (resolved withlookupSubContext(String))- Returns:
- target rest prefix for provided context
-
buildRestPath
- Parameters:
subContext- context resolved withlookupSubContext(String)path- path to resolve- Returns:
- target rest prefix for provided context
-