本文整理汇总了Java中org.springframework.web.servlet.view.AbstractTemplateViewResolver.setAllowRequestOverride方法的典型用法代码示例。如果您正苦于以下问题:Java AbstractTemplateViewResolver.setAllowRequestOverride方法的具体用法?Java AbstractTemplateViewResolver.setAllowRequestOverride怎么用?Java AbstractTemplateViewResolver.setAllowRequestOverride使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.web.servlet.view.AbstractTemplateViewResolver
的用法示例。
在下文中一共展示了AbstractTemplateViewResolver.setAllowRequestOverride方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyToViewResolver
import org.springframework.web.servlet.view.AbstractTemplateViewResolver; //导入方法依赖的package包/类
/**
* Apply the given properties to a {@link AbstractTemplateViewResolver}. Use Object in
* signature to avoid runtime dependency on MVC, which means that the template engine
* can be used in a non-web application.
* @param viewResolver the resolver to apply the properties to.
*/
public void applyToViewResolver(Object viewResolver) {
Assert.isInstanceOf(AbstractTemplateViewResolver.class, viewResolver,
"ViewResolver is not an instance of AbstractTemplateViewResolver :"
+ viewResolver);
AbstractTemplateViewResolver resolver = (AbstractTemplateViewResolver) viewResolver;
resolver.setPrefix(getPrefix());
resolver.setSuffix(getSuffix());
resolver.setCache(isCache());
if (getContentType() != null) {
resolver.setContentType(getContentType().toString());
}
resolver.setViewNames(getViewNames());
resolver.setExposeRequestAttributes(isExposeRequestAttributes());
resolver.setAllowRequestOverride(isAllowRequestOverride());
resolver.setAllowSessionOverride(isAllowSessionOverride());
resolver.setExposeSessionAttributes(isExposeSessionAttributes());
resolver.setExposeSpringMacroHelpers(isExposeSpringMacroHelpers());
resolver.setRequestContextAttribute(getRequestContextAttribute());
// The resolver usually acts as a fallback resolver (e.g. like a
// InternalResourceViewResolver) so it needs to have low precedence
resolver.setOrder(Ordered.LOWEST_PRECEDENCE - 5);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:29,代码来源:AbstractTemplateViewResolverProperties.java