当前位置: 首页>>代码示例>>Java>>正文


Java AbstractTemplateView类代码示例

本文整理汇总了Java中org.springframework.web.servlet.view.AbstractTemplateView的典型用法代码示例。如果您正苦于以下问题:Java AbstractTemplateView类的具体用法?Java AbstractTemplateView怎么用?Java AbstractTemplateView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


AbstractTemplateView类属于org.springframework.web.servlet.view包,在下文中一共展示了AbstractTemplateView类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: decorator

import org.springframework.web.servlet.view.AbstractTemplateView; //导入依赖的package包/类
@RequestMapping("/decorator")
public void decorator(HttpServletRequest request, HttpServletResponse response) throws Exception {
	AbstractTemplateView view = (AbstractTemplateView)viewResolver.resolveViewName("decorator", 
			localeResolver.resolveLocale(request));
	//因为此请求是Sitemesh forward进来的,如果不做下面两个Override配置的话会重复设置Model,而Spring MVC碰到重复参数名会抛异常
	//详细逻辑请阅读 {@link AbstractTemplateView} 的 renderMergedOutputModel方法
	
	//启用spring.freemarker.expose-request-attributes=true时则需要启用下面的代码
	//view.setAllowRequestOverride(true);
	
	//启用spring.freemarker.expose-session-attributes=true时则需要启用下面的代码
	//view.setAllowSessionOverride(true);
	
	view.setExposeSpringMacroHelpers(false);
	view.render(null, request, response);
}
 
开发者ID:easycodebox,项目名称:easycode,代码行数:17,代码来源:GlobalController.java

示例2: call

import org.springframework.web.servlet.view.AbstractTemplateView; //导入依赖的package包/类
@Override
public Object call(Object[] paras, Context ctx) {

	RequestContext requestContext = (RequestContext) ctx
			.getGlobal(AbstractTemplateView.SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE);

	Assert.notNull(requestContext);
	Assert.notNull(paras);
	Assert.isTrue(paras.length > 0);

	String code = (String) paras[0];
	Object[] args = paras.length > 1 ? Arrays.copyOfRange(paras, 1, paras.length) : null;

	return requestContext.getMessage(code, args);
}
 
开发者ID:xiangxik,项目名称:java-platform,代码行数:16,代码来源:I18nFunction.java

示例3: additionalVariableProcessing

import org.springframework.web.servlet.view.AbstractTemplateView; //导入依赖的package包/类
private void additionalVariableProcessing(ConversionService conversionService, Map<String, Object> variables) {
	RequestContext requestContext = (RequestContext) variables.get(AbstractTemplateView.SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE);
	variables.put(SpringContextVariableNames.SPRING_REQUEST_CONTEXT, requestContext);

	ThymeleafEvaluationContext evaluationContext = new ThymeleafEvaluationContext(applicationContext, conversionService);

	variables.put(ThymeleafEvaluationContext.THYMELEAF_EVALUATION_CONTEXT_CONTEXT_VARIABLE_NAME, evaluationContext);
}
 
开发者ID:dtrunk90,项目名称:thymeleaf-jawr-extension,代码行数:9,代码来源:JawrDialectProcessingContextBuilder.java

示例4: initialize

import org.springframework.web.servlet.view.AbstractTemplateView; //导入依赖的package包/类
protected <V extends AbstractTemplateView> V initialize (V view) {
  super.initialize (view);
  view.setAllowRequestOverride (allowRequestOverride);
  view.setAllowSessionOverride (allowSessionOverride);
  view.setExposeRequestAttributes (exposeRequestAttributes);
  view.setExposeSessionAttributes (exposeSessionAttributes);
  view.setExposeSpringMacroHelpers (exposeSpringMacroHelpers);
  return view;
}
 
开发者ID:dfci-cccb,项目名称:mev,代码行数:10,代码来源:AbstractTemplateViewBuilder.java

示例5: doAdditionalVariableProcessing

import org.springframework.web.servlet.view.AbstractTemplateView; //导入依赖的package包/类
private void doAdditionalVariableProcessing(ITest test, Locale locale, Map<String, Object> variables) {
	servletContext.setAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE, applicationContext);

	request.setAttribute(DispatcherServlet.WEB_APPLICATION_CONTEXT_ATTRIBUTE, applicationContext);

	RequestContextHolder.setRequestAttributes(webRequest);

	ConversionService conversionService = getConversionService();

	RequestContext requestContext = new RequestContext(request, response, servletContext, variables);
	variables.put(AbstractTemplateView.SPRING_MACRO_REQUEST_CONTEXT_ATTRIBUTE, requestContext);

	additionalVariableProcessing(conversionService, variables);

	initializeBindingResults(test, conversionService, locale, variables);

	injectJawrProperties(test);
}
 
开发者ID:dtrunk90,项目名称:thymeleaf-jawr-extension,代码行数:19,代码来源:JawrDialectProcessingContextBuilder.java


注:本文中的org.springframework.web.servlet.view.AbstractTemplateView类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。