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


Java TaglibFactory类代码示例

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


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

示例1: initServletContext

import freemarker.ext.jsp.TaglibFactory; //导入依赖的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.jsp.TaglibFactory; //导入依赖的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: prepOfbizRoot

import freemarker.ext.jsp.TaglibFactory; //导入依赖的package包/类
public static void prepOfbizRoot(Map<String, Object> root, HttpServletRequest request, HttpServletResponse response) {
    ServletContext servletContext = (ServletContext) request.getAttribute("servletContext");
    HttpSession session = request.getSession();

    // add in the OFBiz objects
    root.put("delegator", request.getAttribute("delegator"));
    root.put("dispatcher", request.getAttribute("dispatcher"));
    root.put("security", request.getAttribute("security"));
    root.put("userLogin", session.getAttribute("userLogin"));

    // add the response object (for transforms) to the context as a BeanModel
    root.put("response", response);

    // add the application object (for transforms) to the context as a BeanModel
    root.put("application", servletContext);

    // add the servlet context -- this has been deprecated, and now requires servlet, do we really need it?
    //root.put("applicationAttributes", new ServletContextHashModel(servletContext, FreeMarkerWorker.getDefaultOfbizWrapper()));

    // add the session object (for transforms) to the context as a BeanModel
    root.put("session", session);

    // add the session
    root.put("sessionAttributes", new HttpSessionHashModel(session, FreeMarkerWorker.getDefaultOfbizWrapper()));

    // add the request object (for transforms) to the context as a BeanModel
    root.put("request", request);

    // add the request
    root.put("requestAttributes", new HttpRequestHashModel(request, FreeMarkerWorker.getDefaultOfbizWrapper()));

    // add the request parameters -- this now uses a Map from UtilHttp
    Map<String, Object> requestParameters = UtilHttp.getParameterMap(request);
    root.put("requestParameters", requestParameters);

    // add the TabLibFactory
    TaglibFactory JspTaglibs = new TaglibFactory(servletContext);
    root.put("JspTaglibs", JspTaglibs);

}
 
开发者ID:ilscipio,项目名称:scipio-erp,代码行数:41,代码来源:FreeMarkerViewHandler.java

示例4: setServletContext

import freemarker.ext.jsp.TaglibFactory; //导入依赖的package包/类
/**
 * Initialize the {@link TaglibFactory} for the given ServletContext.
 */
@Override
public void setServletContext(ServletContext servletContext) {
	this.taglibFactory = new TaglibFactory(servletContext);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:8,代码来源:FreeMarkerConfigurer.java

示例5: getTaglibFactory

import freemarker.ext.jsp.TaglibFactory; //导入依赖的package包/类
/**
 * Return the TaglibFactory object wrapped by this bean.
 */
@Override
public TaglibFactory getTaglibFactory() {
	return this.taglibFactory;
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:8,代码来源:FreeMarkerConfigurer.java

示例6: setServletContext

import freemarker.ext.jsp.TaglibFactory; //导入依赖的package包/类
/**
 * Initialize the {@link TaglibFactory} for the given ServletContext.
 */
public void setServletContext(ServletContext servletContext) {
	this.taglibFactory = new TaglibFactory(servletContext);
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:7,代码来源:FreeMarkerConfigurer.java

示例7: getTaglibFactory

import freemarker.ext.jsp.TaglibFactory; //导入依赖的package包/类
/**
 * Return the TaglibFactory object wrapped by this bean.
 */
public TaglibFactory getTaglibFactory() {
	return this.taglibFactory;
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:7,代码来源:FreeMarkerConfigurer.java

示例8: getTaglibFactory

import freemarker.ext.jsp.TaglibFactory; //导入依赖的package包/类
/**
 * Returns the {@link TaglibFactory} used to enable JSP tags to be
 * accessed from FreeMarker templates.
 */
TaglibFactory getTaglibFactory();
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:6,代码来源:FreeMarkerConfig.java

示例9: getTaglibFactory

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


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