-
Bug
-
Resolution: Done
-
Major
-
2.2.10.SP1, 2.2.11.Final
-
None
When WeldServletLIfecycle initialises it has a hard dependency on JspFactory.
However, it ought to be possible to use Weld and the weld-servlet-core in a web container, without having Jsp's (or jsp dependencies). Especially since jsp's are getting more and more rare.
Would it therefore be possible to change the following code to check if JspFactory is present before initializing the jsp beans?
if (JspFactory.getDefaultFactory() != null) { JspApplicationContext jspApplicationContext = JspFactory.getDefaultFactory().getJspApplicationContext(context); // Register the ELResolver with JSP jspApplicationContext.addELResolver(manager.getELResolver()); // Register ELContextListener with JSP try { jspApplicationContext.addELContextListener(new WeldELContextListener()); } catch (Exception e) { throw WeldServletLogger.LOG.errorLoadingWeldELContextListener(e); } // Push the wrapped expression factory into the servlet context so that Tomcat or Jetty can hook it in using a container code context.setAttribute(EXPRESSION_FACTORY_NAME, manager.wrapExpressionFactory(jspApplicationContext.getExpressionFactory())); }