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


Java FreemarkerServlet类代码示例

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


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

示例1: buildTemplateModel

import freemarker.ext.servlet.FreemarkerServlet; //导入依赖的package包/类
/**
 * Build a FreeMarker template model for the given model Map.
 * <p>The default implementation builds a {@link AllHttpScopesHashModel}.
 * @param model the model to use for rendering
 * @param request current HTTP request
 * @param response current servlet response
 * @return the FreeMarker template model, as a {@link SimpleHash} or subclass thereof
 */
protected SimpleHash buildTemplateModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) {
	AllHttpScopesHashModel fmModel = new AllHttpScopesHashModel(getObjectWrapper(), getServletContext(), request);
	fmModel.put(FreemarkerServlet.KEY_JSP_TAGLIBS, this.taglibFactory);
	fmModel.put(FreemarkerServlet.KEY_APPLICATION, this.servletContextHashModel);
	fmModel.put(FreemarkerServlet.KEY_SESSION, buildSessionModel(request, response));
	fmModel.put(FreemarkerServlet.KEY_REQUEST, new HttpRequestHashModel(request, response, getObjectWrapper()));
	fmModel.put(FreemarkerServlet.KEY_REQUEST_PARAMETERS, new HttpRequestParametersHashModel(request));
	fmModel.putAll(model);
	return fmModel;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:19,代码来源:FreeMarkerView.java

示例2: buildTemplateModel

import freemarker.ext.servlet.FreemarkerServlet; //导入依赖的package包/类
protected SimpleHash buildTemplateModel(Map<String, Object> model, WebContext rc) {
	AllHttpScopesHashModel fmModel = new AllHttpScopesHashModel(getObjectWrapper(), rc.getContext(), rc.getRequest());
	fmModel.put(FreemarkerServlet.KEY_JSP_TAGLIBS, this.taglibFactory);
	fmModel.put(FreemarkerServlet.KEY_APPLICATION, this.servletContextHashModel);
	fmModel.put(FreemarkerServlet.KEY_SESSION, buildSessionModel(rc.getRequest(), rc.getResponse()));
	fmModel.put(FreemarkerServlet.KEY_REQUEST, new HttpRequestHashModel(rc.getRequest(), rc.getResponse(), getObjectWrapper()));
	fmModel.put(FreemarkerServlet.KEY_REQUEST_PARAMETERS, new HttpRequestParametersHashModel(rc.getRequest()));
	fmModel.putAll(model);
	return fmModel;
}
 
开发者ID:ketayao,项目名称:fensy,代码行数:11,代码来源:FreeMarkerView.java

示例3: buildTemplateModel

import freemarker.ext.servlet.FreemarkerServlet; //导入依赖的package包/类
@Override
protected SimpleHash buildTemplateModel(Map<String, Object> model, HttpServletRequest request, HttpServletResponse response) {
    SimpleHash hash = super.buildTemplateModel(model, request, response);
    hash.put(FreemarkerServlet.KEY_INCLUDE, new IncludePage(request, response));
    return hash;
}
 
开发者ID:ImKarl,项目名称:ccshop,代码行数:7,代码来源:FreemarkerView.java


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