Package ru.vyarus.guicey.gsp.app
Class ServerPagesApp
java.lang.Object
ru.vyarus.guicey.gsp.app.ServerPagesApp
Server pages application initialization logic.
Application register:
- Special assets servlet (with multiple classpath locations support)
- Main
ServerPagesFilteraround assets servlet which differentiate asset and template requests (and handle error pages)
- Since:
- 11.01.2019
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AssetSourcesAssets location registrations.protected AssetLookupAll locations, including all extensions.Error pages.protected StringRegexp for file requests detection (to recognize asset or direct template render).protected StringContext mapping + uriPath.protected List<HiddenViewPath>Hidden view paths.protected StringIndex file name.protected StringRoot assets location.protected booleanTrue for the main context, false for admin.protected StringApplication name.Required template renderer names.protected StringAssets detection pattern (to prevent redirection to the index page).protected booleanTrue if SPA support required.protected TemplateRedirectTemplate redirector.protected StringApplication mapping url.protected List<MappedViewPath>View paths.protected final ViewRestSourcesView rest prefixes mappings.protected ViewRestLookupViews lookup.protected final Map<String,ViewRendererConfigurationModifier> Delayed modifiers registration. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetInfo(ServerPagesGlobalState config) getName()voidinstall(io.dropwizard.core.setup.Environment environment, ServerPagesGlobalState config) Install configured server page app.protected booleanvoidjerseyStarted(String restContext, String restMapping, RestPathsAnalyzer analyzer) Delayed initialization.
-
Field Details
-
name
Application name. -
mainContext
protected boolean mainContextTrue for the main context, false for admin. -
mainAssetsPath
Root assets location. -
uriPath
Application mapping url. -
indexFile
Index file name. -
fileRequestPattern
Regexp for file requests detection (to recognize asset or direct template render). -
requiredRenderers
Required template renderer names. -
spaSupport
protected boolean spaSupportTrue if SPA support required. -
spaNoRedirectRegex
Assets detection pattern (to prevent redirection to the index page). -
viewsConfigModifiers
Delayed modifiers registration. -
assetLocations
Assets location registrations. -
viewPrefixes
View rest prefixes mappings. -
errorPages
Error pages. -
fullUriPath
Context mapping + uriPath. -
templateRedirect
Template redirector. -
assets
All locations, including all extensions. -
views
Views lookup. -
viewPaths
View paths.
-
-
Constructor Details
-
ServerPagesApp
public ServerPagesApp()
-
-
Method Details
-
getName
- Returns:
- application name
-
install
public void install(io.dropwizard.core.setup.Environment environment, ServerPagesGlobalState config) Install configured server page app. Called after all guicey bundles processing (when all extensions registered).- Parameters:
environment- dropwizard environment objectconfig- global configuration object
-
jerseyStarted
Delayed initialization. Important to call when jersey initialization finished to get correct rest path and make sure all extended registrations (other bundles extending app) are performed.- Parameters:
restContext- rest context mapping ( == main context mapping)restMapping- servlet mapping (under main context)analyzer- rest analyzer
-
getInfo
- Parameters:
config- configuration- Returns:
- gsp applications info
-
isStarted
protected boolean isStarted()- Returns:
- true if application already started, false otherwise
-