Package net.shibboleth.shared.spring.velocity

# Class VelocityViewResolver

java.lang.Object
org.springframework.context.support.ApplicationObjectSupport
org.springframework.web.context.support.WebApplicationObjectSupport
org.springframework.web.servlet.view.AbstractCachingViewResolver
org.springframework.web.servlet.view.UrlBasedViewResolver
org.springframework.web.servlet.view.AbstractTemplateViewResolver
net.shibboleth.shared.spring.velocity.VelocityViewResolver

All Implemented Interfaces:
  `Aware`, `ApplicationContextAware`, `Ordered`, `ServletContextAware`, `ViewResolver`

public class VelocityViewResolver extends AbstractTemplateViewResolver
Convenience subclass of `UrlBasedViewResolver` that supports `VelocityView` (i.e. Velocity templates) and custom subclasses of it.

Note: When chaining ViewResolvers, a VelocityViewResolver will check for the existence of the specified template resources and only return a non-null View object if the template was actually found.

Since:
  6.0.0

## Nested Class Summary

## Nested classes/interfaces inherited from class org.springframework.web.servlet.view.AbstractCachingViewResolver

`AbstractCachingViewResolver.CacheFilter`

## Field Summary

Fields
Modifier and Type
Field
Description
`private final Predicate<String>`
`activationCondition`
Activation condition for view resolver.

### Fields inherited from class org.springframework.web.servlet.view.UrlBasedViewResolver

`FORWARD_URL_PREFIX, REDIRECT_URL_PREFIX`

### Fields inherited from class org.springframework.web.servlet.view.AbstractCachingViewResolver

`DEFAULT_CACHE_LIMIT`

### Fields inherited from class org.springframework.context.support.ApplicationObjectSupport

`logger`

### Fields inherited from interface org.springframework.core.Ordered

`HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE`

## Constructor Summary

Constructors
Constructor
Description
`VelocityViewResolver()`
Constructor.
`VelocityViewResolver(Predicate<String> condition)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`View`
`resolveViewName(String viewName, Locale locale)`

### Methods inherited from class org.springframework.web.servlet.view.AbstractTemplateViewResolver

`buildView, requiredViewClass, setAllowRequestOverride, setAllowSessionOverride, setExposeRequestAttributes, setExposeSessionAttributes, setExposeSpringMacroHelpers`

### Methods inherited from class org.springframework.web.servlet.view.UrlBasedViewResolver

`applyLifecycleMethods, canHandle, createView, getAttributesMap, getCacheKey, getContentType, getExposeContextBeansAsAttributes, getExposedContextBeanNames, getExposePathVariables, getOrder, getPrefix, getRedirectHosts, getRequestContextAttribute, getSuffix, getViewClass, getViewNames, initApplicationContext, instantiateView, isRedirectContextRelative, isRedirectHttp10Compatible, loadView, setAttributes, setAttributesMap, setContentType, setExposeContextBeansAsAttributes, setExposedContextBeanNames, setExposePathVariables, setOrder, setPrefix, setRedirectContextRelative, setRedirectHosts, setRedirectHttp10Compatible, setRequestContextAttribute, setSuffix, setViewClass, setViewNames`

### Methods inherited from class org.springframework.web.servlet.view.AbstractCachingViewResolver

`clearCache, getCacheFilter, getCacheLimit, isCache, isCacheUnresolved, removeFromCache, setCache, setCacheFilter, setCacheLimit, setCacheUnresolved`

### Methods inherited from class org.springframework.web.context.support.WebApplicationObjectSupport

`getServletContext, getTempDir, getWebApplicationContext, initApplicationContext, initServletContext, isContextRequired, setServletContext`

### Methods inherited from class org.springframework.context.support.ApplicationObjectSupport

`getApplicationContext, getMessageSourceAccessor, obtainApplicationContext, requiredContextClass, setApplicationContext`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### activationCondition

@Nonnull private final Predicate<String> activationCondition
Activation condition for view resolver.

## Constructor Details

### VelocityViewResolver

public VelocityViewResolver()
Constructor.

### VelocityViewResolver

public VelocityViewResolver(@Nonnull @ParameterName(name="condition") Predicate<String> condition)
Constructor.

Parameters:
  `condition` - activation condition
Since:
  9.1.0

## Method Details

### resolveViewName

@Nullable public View resolveViewName(@Nonnull String viewName, @Nonnull Locale locale) throws Exception

Specified by:
  `resolveViewName` in interface `ViewResolver`
Overrides:
  `resolveViewName` in class `AbstractCachingViewResolver`
Throws:
  `Exception`