本文整理汇总了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());
}
示例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");
}
}
示例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);
}
示例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);
}
示例5: getTaglibFactory
import freemarker.ext.jsp.TaglibFactory; //导入依赖的package包/类
/**
* Return the TaglibFactory object wrapped by this bean.
*/
@Override
public TaglibFactory getTaglibFactory() {
return this.taglibFactory;
}
示例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);
}
示例7: getTaglibFactory
import freemarker.ext.jsp.TaglibFactory; //导入依赖的package包/类
/**
* Return the TaglibFactory object wrapped by this bean.
*/
public TaglibFactory getTaglibFactory() {
return this.taglibFactory;
}
示例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();
示例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;
}