public final class RegisteredServiceThemeBasedViewResolver
extends org.springframework.web.servlet.view.InternalResourceViewResolver
RegisteredServiceThemeBasedViewResolver is an alternate Spring View Resolver that utilizes a service's
associated theme to selectively choose which set of UI views will be used to generate
the standard views (casLoginView.jsp, casLogoutView.jsp etc).
Views associated with a particular theme by default are expected to be found at:
DEFAULT_PATH_PREFIX/themeId/ui. A starting point may be to
clone the default set of view pages into a new directory based on the theme id.
Note: There also exists a ServiceThemeResolver
that attempts to resolve the view name based on the service theme id. The difference
however is that ServiceThemeResolver only decorates
the default view pages with additional tags and coloring, such as CSS and JS. The
component presented here on the other hand has the ability to load an entirely new
set of pages that are may be totally different from that of the default's. This
is specially useful in cases where the set of pages for a theme that are targetted
for a different type of audience are entirely different structurally that simply
using the ServiceThemeResolver is not practical
to augment the default views. In such cases, new view pages may be required.
FORWARD_URL_PREFIX, REDIRECT_URL_PREFIX| Constructor and Description |
|---|
RegisteredServiceThemeBasedViewResolver(String defaultThemeId,
ServicesManager servicesManager)
The
RegisteredServiceThemeBasedViewResolver constructor. |
| Modifier and Type | Method and Description |
|---|---|
protected org.springframework.web.servlet.view.AbstractUrlBasedView |
buildView(String viewName)
Uses the viewName and the theme associated with the service.
|
void |
setCache(boolean cache)
setCache is not supported in the
RegisteredServiceThemeBasedViewResolver because each
request must be independently evaluated. |
void |
setPathPrefix(String pathPrefix)
Sets path prefix.
|
requiredViewClass, setAlwaysIncludecanHandle, createView, getAttributesMap, getCacheKey, getContentType, getExposeContextBeansAsAttributes, getExposedContextBeanNames, getExposePathVariables, getOrder, getPrefix, getRequestContextAttribute, getSuffix, getViewClass, getViewNames, initApplicationContext, isRedirectContextRelative, isRedirectHttp10Compatible, loadView, setAttributes, setAttributesMap, setContentType, setExposeContextBeansAsAttributes, setExposedContextBeanNames, setExposePathVariables, setOrder, setPrefix, setRedirectContextRelative, setRedirectHttp10Compatible, setRequestContextAttribute, setSuffix, setViewClass, setViewNamesclearCache, getCacheLimit, isCache, isCacheUnresolved, removeFromCache, resolveViewName, setCacheLimit, setCacheUnresolvedgetServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContextpublic RegisteredServiceThemeBasedViewResolver(String defaultThemeId, ServicesManager servicesManager)
RegisteredServiceThemeBasedViewResolver constructor.defaultThemeId - the theme to apply if the service doesn't specific one or a service is not providedservicesManager - the serviceManager implementationsetCache(boolean)protected org.springframework.web.servlet.view.AbstractUrlBasedView buildView(String viewName) throws Exception
buildView in class org.springframework.web.servlet.view.InternalResourceViewResolverviewName - the name of the view to be resolvedException - an exceptionpublic void setCache(boolean cache)
RegisteredServiceThemeBasedViewResolver because each
request must be independently evaluated.setCache in class org.springframework.web.servlet.view.AbstractCachingViewResolvercache - a value indicating whether the view should cache results.public void setPathPrefix(String pathPrefix)
DEFAULT_PATH_PREFIX.pathPrefix - the path prefixCopyright © 2004-2016 Apereo. All Rights Reserved.