}
tldListenerMap.putAll(appLibTldMap);
servletContext.setAttribute(
"com.sun.appserv.tldlistener.map", tldListenerMap);
Habitat defaultHabitat =
webContainer.getServerContext().getDefaultHabitat();
// set habitat for jsf injection
servletContext.setAttribute(
Constants.HABITAT_ATTRIBUTE, defaultHabitat);
SunWebApp bean = webModule.getIasWebAppConfigBean();
// Find the default jsp servlet
Wrapper wrapper = (Wrapper) webModule.findChild(
org.apache.catalina.core.Constants.JSP_SERVLET_NAME);
if (wrapper == null) {
return;
}
if (webModule.getTldValidation()) {
wrapper.addInitParameter("enableTldValidation", "true");
}
if (bean != null && bean.getJspConfig() != null) {
WebProperty[] props = bean.getJspConfig().getWebProperty();
for (int i = 0; i < props.length; i++) {
String pname = props[i].getAttributeValue("name");
String pvalue = props[i].getAttributeValue("value");
if (_logger.isLoggable(Level.FINE)) {
_logger.fine("jsp-config property for [" +
webModule.getID() + "] is [" + pname +
"] = [" + pvalue + "]");
}
wrapper.addInitParameter(pname, pvalue);
}
}
// Override any log setting with the container wide logging level
wrapper.addInitParameter("logVerbosityLevel",getJasperLogLevel());
ResourceInjectorImpl resourceInjector = new ResourceInjectorImpl(
webModule);
servletContext.setAttribute(
"com.sun.appserv.jsp.resource.injector",
resourceInjector);
// START SJSAS 6311155
String sysClassPath = ASClassLoaderUtil.getModuleClassPath(
defaultHabitat,
webModule.getID(), null
);
// If the configuration flag usMyFaces is set, remove javax.faces.jar
// and from the system class path
Boolean useMyFaces = (Boolean)
servletContext.getAttribute("com.sun.faces.useMyFaces");
if (useMyFaces != null && useMyFaces) {
sysClassPath =
sysClassPath.replace("javax.faces.jar", "$disabled$.raj");
// jsf-connector.jar manifest has a Class-Path to javax.faces.jar
sysClassPath =
sysClassPath.replace("jsf-connector.jar", "$disabled$.raj");
}
// TODO: combine with classpath from
// servletContext.getAttribute(("org.apache.catalina.jsp_classpath")
if (_logger.isLoggable(Level.FINE)) {
_logger.fine(" sysClasspath for " + webModule.getID() + " is \n" +
sysClassPath + "\n");
}
if (sysClassPath.equals("")) {
// In embedded mode, habitat returns SingleModulesRegistry and
// it has no modules.
// Try "java.class.path" system property instead.
sysClassPath = System.getProperty("java.class.path");
}
sysClassPath = trimSysClassPath(sysClassPath);
wrapper.addInitParameter("com.sun.appserv.jsp.classpath",
sysClassPath);
// END SJSAS 6311155
// Configure JSP monitoring
servletContext.setAttribute(
"org.glassfish.jsp.monitor.probeEmitter",
new JspProbeEmitterImpl(webModule));
// Pass BeanManager's ELResolver as ServletContext attribute
// (see IT 11168)
InvocationManager invocationMgr =
webContainer.getInvocationManager();
WebComponentInvocation inv = new WebComponentInvocation(webModule);
try {
invocationMgr.preInvoke(inv);
JCDIService jcdiService = defaultHabitat.getByContract(JCDIService.class);
// JCDIService can be absent if weld integration is missing in the runtime, so check for null is needed.
if (jcdiService != null && jcdiService.isCurrentModuleJCDIEnabled()) {
jcdiService.setELResolver(servletContext);
}
} catch (NamingException e) {