* @param wbd WebBundleDescriptor of the web module whose sun-web.xml
* is used to configure the given JspC instance
*/
private static void configureJspc(JspC jspc, WebBundleDescriptor wbd) {
SunWebApp sunWebApp = wbd.getSunDescriptor();
if (sunWebApp == null) {
return;
}
ClassLoader classloader = sunWebApp.getClassLoader();
if (classloader != null) {
String delegate = classloader.getAttributeValue("Delegate");
if (delegate != null) {
jspc.setDelegate(Boolean.valueOf(delegate).booleanValue());
}
}
// START SJSAS 6384538
if (sunWebApp.sizeWebProperty() > 0) {
WebProperty[] props = sunWebApp.getWebProperty();
for (int i = 0; i < props.length; i++) {
String pName = props[i].getAttributeValue("name");
String pValue = props[i].getAttributeValue("value");
if (pName == null || pValue == null) {
throw new IllegalArgumentException(
"Missing sun-web-app property name or value");
}
if ("enableTldValidation".equals(pName)) {
jspc.setIsValidationEnabled(
Boolean.valueOf(pValue).booleanValue());
}
}
}
// END SJSAS 6384538
// START SJSAS 6170435
/*
* Configure JspC with the init params of the JspServlet
*/
Set set = wbd.getWebComponentDescriptorsSet();
if (!set.isEmpty()) {
Iterator<WebComponentDescriptor> iterator = set.iterator();
while (iterator.hasNext()) {
WebComponentDescriptor webComponentDesc = iterator.next();
if ("jsp".equals(webComponentDesc.getCanonicalName())) {
Enumeration<InitializationParameter> en
= webComponentDesc.getInitializationParameters();
if (en != null) {
while (en.hasMoreElements()) {
InitializationParameter initP = en.nextElement();
configureJspc(jspc,
initP.getName(),
initP.getValue());
}
}
break;
}
}
}
// END SJSAS 6170435
/*
* Configure JspC with jsp-config properties from sun-web.xml,
* which override JspServlet init params of the same name.
*/
JspConfig jspConfig = sunWebApp.getJspConfig();
if (jspConfig == null) {
return;
}
WebProperty[] props = jspConfig.getWebProperty();
for (int i=0; props!=null && i<props.length; i++) {