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


Java JspFactory.getDefaultFactory方法代码示例

本文整理汇总了Java中javax.servlet.jsp.JspFactory.getDefaultFactory方法的典型用法代码示例。如果您正苦于以下问题:Java JspFactory.getDefaultFactory方法的具体用法?Java JspFactory.getDefaultFactory怎么用?Java JspFactory.getDefaultFactory使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.servlet.jsp.JspFactory的用法示例。


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

示例1: getWrapper

import javax.servlet.jsp.JspFactory; //导入方法依赖的package包/类
private static WrapperIF getWrapper() {
  if (wrapper != null)
    return wrapper;

  if (JspFactory.getDefaultFactory() == null)
    // ontojsp can't set the default factory, since ontojsp needs to
    // be able to run inside app servers, which will set the default.
    // in the test suite there will therefore be no default factory.
    return new JSP12Wrapper(); 

  JspEngineInfo engine = JspFactory.getDefaultFactory().getEngineInfo();
  String version = engine.getSpecificationVersion();
  switch (version) {
    case "2.0": return new JSP20Wrapper();
    case "1.2": return new JSP12Wrapper();
    default: return new JSP11Wrapper();
  }
}
 
开发者ID:ontopia,项目名称:ontopia,代码行数:19,代码来源:JSPEngineWrapper.java

示例2: createEvaluator

import javax.servlet.jsp.JspFactory; //导入方法依赖的package包/类
public AttributeEvaluator createEvaluator() {
	try {
		// jsp-api-2.1 doesn't default instantiate a factory for us
		JspFactory factory = JspFactory.getDefaultFactory();
		if ((factory != null) && (factory.getJspApplicationContext(servletContext).getExpressionFactory() != null)) {
			logger.info("Found JSP 2.1 ExpressionFactory");
			ELAttributeEvaluator evaluator = new ELAttributeEvaluator();
			evaluator.setExpressionFactory(factory.getJspApplicationContext(servletContext).getExpressionFactory());
			evaluator.setResolver(new CompositeELResolverImpl());
			return evaluator;
		}
	}
	catch (Throwable ex) {
		logger.warn("Could not obtain JSP 2.1 ExpressionFactory", ex);
	}
	return null;
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:18,代码来源:TilesConfigurer.java

示例3: doExecute

import javax.servlet.jsp.JspFactory; //导入方法依赖的package包/类
protected ActionForward doExecute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception {

        JspFactory _jspxFactory = null;
        PageContext pageContext = null;
        _jspxFactory = JspFactory.getDefaultFactory();
        response.setContentType("text/html");

        pageContext = _jspxFactory.getPageContext(this.getServlet(), request, response, null, true, 8192, true);
        JspContext jspContext = pageContext;
        java.util.ArrayList _jspx_nested = null;
        java.util.ArrayList _jspx_at_begin = null;
        java.util.ArrayList _jspx_at_end = null;
        jspContext = new org.apache.jasper.runtime.JspContextWrapper(jspContext, _jspx_nested, _jspx_at_begin, _jspx_at_end, null);

        /*patientid_005fdistricts_tag tag = new patientid_005fdistricts_tag();
        tag.setJspContext(jspContext);
        try {
            tag.doTag();
        } catch (JspException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        }*/

        return mapping.findForward(SUCCESS_FORWARD);
    }
 
开发者ID:chrisekelley,项目名称:zeprs,代码行数:27,代码来源:RenderPageAction.java

示例4: createAttributeEvaluatorFactory

import javax.servlet.jsp.JspFactory; //导入方法依赖的package包/类
@Override
protected AttributeEvaluatorFactory createAttributeEvaluatorFactory(ApplicationContext context,
		LocaleResolver resolver) {
	AttributeEvaluator evaluator;
	if (tilesElPresent && JspFactory.getDefaultFactory() != null) {
		evaluator = new TilesElActivator().createEvaluator();
	}
	else {
		evaluator = new DirectAttributeEvaluator();
	}
	return new BasicAttributeEvaluatorFactory(evaluator);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:13,代码来源:TilesConfigurer.java

示例5: createAttributeEvaluatorFactory

import javax.servlet.jsp.JspFactory; //导入方法依赖的package包/类
@Override
protected AttributeEvaluatorFactory createAttributeEvaluatorFactory(TilesApplicationContext applicationContext,
		TilesRequestContextFactory contextFactory, LocaleResolver resolver) {
	AttributeEvaluator evaluator;
	if (tilesElPresent && JspFactory.getDefaultFactory() != null) {
		evaluator = TilesElActivator.createEvaluator(applicationContext);
	}
	else {
		evaluator = new DirectAttributeEvaluator();
	}
	return new BasicAttributeEvaluatorFactory(evaluator);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:13,代码来源:TilesConfigurer.java

示例6: setServletContext

import javax.servlet.jsp.JspFactory; //导入方法依赖的package包/类
@Override
public void setServletContext(ServletContext servletContext) {
	super.setServletContext(servletContext);
	DynamicELResolver elResolver = (DynamicELResolver) servletContext
			.getAttribute(EL_RESOLVER_KEY);
	if (elResolver == null) {
		elResolver = new DynamicELResolver();
		JspFactory jspFactory = JspFactory.getDefaultFactory();
		JspApplicationContext jspContext = jspFactory
				.getJspApplicationContext(servletContext);
		jspContext.addELResolver(elResolver);
		servletContext.setAttribute(EL_RESOLVER_KEY, elResolver);
	}
	elResolver.setBeanFactory(this.beanFactory);
}
 
开发者ID:vmware,项目名称:ward,代码行数:16,代码来源:CommonConfiguration.java

示例7: isExpressionFactoryAvailable

import javax.servlet.jsp.JspFactory; //导入方法依赖的package包/类
public boolean isExpressionFactoryAvailable() {
	try {
		JspFactory factory = JspFactory.getDefaultFactory();
		if (factory != null &&
				factory.getJspApplicationContext(servletContext).getExpressionFactory() != null) {
			logger.info("Found JSP 2.1 ExpressionFactory");
			return true;
		}
	}
	catch (Throwable ex) {
		logger.warn("Could not obtain JSP 2.1 ExpressionFactory", ex);
	}
	return false;
}
 
开发者ID:deathspeeder,项目名称:class-guard,代码行数:15,代码来源:TilesConfigurer.java

示例8: setupJspFactory

import javax.servlet.jsp.JspFactory; //导入方法依赖的package包/类
private void setupJspFactory() {

		try {
			if (JspFactory.getDefaultFactory() == null) {
				// enforce setting the jspfactory instance as we know it here
				Class clz = Class.forName("org.apache.jasper.runtime.JspFactoryImpl"); //$NON-NLS-1$
				if (clz != null) {
					JspFactory.setDefaultFactory((JspFactory) clz.newInstance());
				}
			}
		} catch (Exception ex) {

		}
	}
 
开发者ID:eclipse,项目名称:birt,代码行数:15,代码来源:ViewerPlugin.java

示例9: setJspELFactory

import javax.servlet.jsp.JspFactory; //导入方法依赖的package包/类
/**
 * On Tomcat we need to sometimes force a class load to get our hands on the JspFactory
 */
private static void setJspELFactory(ServletContext startupObject, ELResolver resolver)
{
    JspFactory factory = JspFactory.getDefaultFactory();
    if (factory == null)
    {
        try
        {
            try {
                Class.forName("org.apache.jasper.servlet.JasperInitializer");
            } catch (final Throwable th) {
                Class.forName("org.apache.jasper.compiler.JspRuntimeContext");
            }
            factory = JspFactory.getDefaultFactory();
        }
        catch (Exception e)
        {
            // ignore
        }

    }

    if (factory != null)
    {
        JspApplicationContext applicationCtx = factory.getJspApplicationContext(startupObject);
        applicationCtx.addELResolver(resolver);
    }
    else
    {
        logger.debug("Default JSPFactroy instance has not found. Skipping OWB JSP handling");
    }
}
 
开发者ID:apache,项目名称:tomee,代码行数:35,代码来源:OpenEJBLifecycle.java


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