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


Java ServletContextHashModel类代码示例

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


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

示例1: initServletContext

import freemarker.ext.servlet.ServletContextHashModel; //导入依赖的package包/类
/**
 * Invoked on startup. Looks for a single FreeMarkerConfig bean to
 * find the relevant Configuration for this factory.
 * <p>Checks that the template for the default Locale can be found:
 * FreeMarker will check non-Locale-specific templates if a
 * locale-specific one is not found.
 * @see freemarker.cache.TemplateCache#getTemplate
 */
@Override
protected void initServletContext(ServletContext servletContext) throws BeansException {
	if (getConfiguration() != null) {
		this.taglibFactory = new TaglibFactory(servletContext);
	}
	else {
		FreeMarkerConfig config = autodetectConfiguration();
		setConfiguration(config.getConfiguration());
		this.taglibFactory = config.getTaglibFactory();
	}

	GenericServlet servlet = new GenericServletAdapter();
	try {
		servlet.init(new DelegatingServletConfig());
	}
	catch (ServletException ex) {
		throw new BeanInitializationException("Initialization of GenericServlet adapter failed", ex);
	}
	this.servletContextHashModel = new ServletContextHashModel(servlet, getObjectWrapper());
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:29,代码来源:FreeMarkerView.java

示例2: finishConfig

import freemarker.ext.servlet.ServletContextHashModel; //导入依赖的package包/类
/**
 * Initialize FreeMarker elements after servlet context and FreeMarker configuration have both
 * been populated.
 */
private static void finishConfig() {
    if (freeMarkerConfig != null && servletContext != null) {
        taglibFactory = new TaglibFactory(servletContext);
        
        objectWrapper = freeMarkerConfig.getObjectWrapper();
        if (objectWrapper == null) {
            objectWrapper = ObjectWrapper.DEFAULT_WRAPPER;
        }

        GenericServlet servlet = new ServletAdapter();
        try {
            servlet.init(new DelegatingServletConfig());
        } catch (ServletException ex) {
            throw new BeanInitializationException("Initialization of GenericServlet adapter failed", ex);
        }
        
        servletContextHashModel = new ServletContextHashModel(servlet, ObjectWrapper.DEFAULT_WRAPPER);
        
        LOG.info("Freemarker configuration complete");
    }
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:26,代码来源:FreeMarkerInlineRenderBootstrap.java

示例3: getServletContextHashModel

import freemarker.ext.servlet.ServletContextHashModel; //导入依赖的package包/类
/**
 * Get the servlet context hash model for use in the component rendering phase.
 * 
 * @return The servlet context hash model for use in the component rendering phase.
 */
public static ServletContextHashModel getServletContextHashModel() {
    return servletContextHashModel;
}
 
开发者ID:kuali,项目名称:kc-rice,代码行数:9,代码来源:FreeMarkerInlineRenderBootstrap.java


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