Class ServerPagesApp

java.lang.Object
ru.vyarus.guicey.gsp.app.ServerPagesApp

public class ServerPagesApp extends Object
Server pages application initialization logic. Application register:
  • Special assets servlet (with multiple classpath locations support)
  • Main ServerPagesFilter around assets servlet which differentiate asset and template requests (and handle error pages)
Since:
11.01.2019
  • Field Details

    • name

      protected String name
      Application name.
    • mainContext

      protected boolean mainContext
      True for the main context, false for admin.
    • mainAssetsPath

      protected String mainAssetsPath
      Root assets location.
    • uriPath

      protected String uriPath
      Application mapping url.
    • indexFile

      protected String indexFile
      Index file name.
    • fileRequestPattern

      protected String fileRequestPattern
      Regexp for file requests detection (to recognize asset or direct template render).
    • requiredRenderers

      protected List<String> requiredRenderers
      Required template renderer names.
    • spaSupport

      protected boolean spaSupport
      True if SPA support required.
    • spaNoRedirectRegex

      protected String spaNoRedirectRegex
      Assets detection pattern (to prevent redirection to the index page).
    • viewsConfigModifiers

      protected final Map<String,ViewRendererConfigurationModifier> viewsConfigModifiers
      Delayed modifiers registration.
    • assetLocations

      protected final AssetSources assetLocations
      Assets location registrations.
    • viewPrefixes

      protected final ViewRestSources viewPrefixes
      View rest prefixes mappings.
    • errorPages

      protected final Map<Integer,String> errorPages
      Error pages.
    • fullUriPath

      protected String fullUriPath
      Context mapping + uriPath.
    • templateRedirect

      protected TemplateRedirect templateRedirect
      Template redirector.
    • assets

      protected AssetLookup assets
      All locations, including all extensions.
    • views

      protected ViewRestLookup views
      Views lookup.
    • viewPaths

      protected List<MappedViewPath> viewPaths
      View paths.
    • hiddenViewPaths

      protected List<HiddenViewPath> hiddenViewPaths
      Hidden view paths.
  • Constructor Details

    • ServerPagesApp

      public ServerPagesApp()
  • Method Details

    • getName

      public String 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 object
      config - global configuration object
    • jerseyStarted

      public void jerseyStarted(String restContext, String restMapping, RestPathsAnalyzer analyzer)
      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

      public GspApp getInfo(ServerPagesGlobalState config)
      Parameters:
      config - configuration
      Returns:
      gsp applications info
    • isStarted

      protected boolean isStarted()
      Returns:
      true if application already started, false otherwise