in src/main/java/org/apache/sling/scripting/jsp/JspServletOptions.java [334:562]
public JspServletOptions(ServletContext servletContext,
IOProvider ioProvider, Map<String, Object> config,
TldLocationsCache tldLocationsCache,
boolean defaultIsSession) {
this.defaultIsSession = defaultIsSession;
// JVM version numbers default to current vm version
this.compilerSourceVM = System.getProperty("java.specification.version");
this.compilerTargetVM = this.compilerSourceVM;
for(final Map.Entry<String, Object> entry : config.entrySet()) {
String key = entry.getKey();
if (key.startsWith("jasper.")) {
final Object value = entry.getValue();
if (value != null) {
final String strValue = String.valueOf(value).trim();
if ( strValue.length() > 0 ) {
setProperty(key.substring("jasper.".length()), strValue);
}
}
}
}
// quick hack
// String validating=config.getInitParameter( "validating");
// if( "false".equals( validating )) ParserUtils.validating=false;
String keepgen = getProperty("keepgenerated");
if (keepgen != null) {
if (keepgen.equalsIgnoreCase("true")) {
this.keepGenerated = true;
} else if (keepgen.equalsIgnoreCase("false")) {
this.keepGenerated = false;
} else {
if (log.isWarnEnabled()) {
log.warn(Localizer.getMessage("jsp.warning.keepgen"));
}
}
}
String trimsp = getProperty("trimSpaces");
if (trimsp != null) {
if (trimsp.equalsIgnoreCase("true")) {
this.trimSpaces = true;
} else if (trimsp.equalsIgnoreCase("false")) {
this.trimSpaces = false;
} else {
if (log.isWarnEnabled()) {
log.warn(Localizer.getMessage("jsp.warning.trimspaces"));
}
}
}
String dpsFrags = getProperty("displaySourceFragments");
if (dpsFrags != null) {
if (dpsFrags.equalsIgnoreCase("true")) {
this.displaySourceFragments = true;
} else if (dpsFrags.equalsIgnoreCase("false")) {
this.displaySourceFragments = false;
} else {
if (log.isWarnEnabled()) {
log.warn(Localizer.getMessage("jsp.warning.displaySourceFragment"));
}
}
}
this.isPoolingEnabled = true;
String poolingEnabledParam = getProperty("enablePooling");
if (poolingEnabledParam != null
&& !poolingEnabledParam.equalsIgnoreCase("true")) {
if (poolingEnabledParam.equalsIgnoreCase("false")) {
this.isPoolingEnabled = false;
} else {
if (log.isWarnEnabled()) {
log.warn(Localizer.getMessage("jsp.warning.enablePooling"));
}
}
}
String mapFile = getProperty("mappedfile");
if (mapFile != null) {
if (mapFile.equalsIgnoreCase("true")) {
this.mappedFile = true;
} else if (mapFile.equalsIgnoreCase("false")) {
this.mappedFile = false;
} else {
if (log.isWarnEnabled()) {
log.warn(Localizer.getMessage("jsp.warning.mappedFile"));
}
}
}
String senderr = getProperty("sendErrToClient");
if (senderr != null) {
if (senderr.equalsIgnoreCase("true")) {
this.sendErrorToClient = true;
} else if (senderr.equalsIgnoreCase("false")) {
this.sendErrorToClient = false;
} else {
if (log.isWarnEnabled()) {
log.warn(Localizer.getMessage("jsp.warning.sendErrToClient"));
}
}
}
String debugInfo = getProperty("classdebuginfo");
if (debugInfo != null) {
if (debugInfo.equalsIgnoreCase("true")) {
this.classDebugInfo = true;
} else if (debugInfo.equalsIgnoreCase("false")) {
this.classDebugInfo = false;
} else {
if (log.isWarnEnabled()) {
log.warn(Localizer.getMessage("jsp.warning.classDebugInfo"));
}
}
}
String suppressSmap = getProperty("suppressSmap");
if (suppressSmap != null) {
if (suppressSmap.equalsIgnoreCase("true")) {
this.isSmapSuppressed = true;
} else if (suppressSmap.equalsIgnoreCase("false")) {
this.isSmapSuppressed = false;
} else {
if (log.isWarnEnabled()) {
log.warn(Localizer.getMessage("jsp.warning.suppressSmap"));
}
}
}
String dumpSmap = getProperty("dumpSmap");
if (dumpSmap != null) {
if (dumpSmap.equalsIgnoreCase("true")) {
this.isSmapDumped = true;
} else if (dumpSmap.equalsIgnoreCase("false")) {
this.isSmapDumped = false;
} else {
if (log.isWarnEnabled()) {
log.warn(Localizer.getMessage("jsp.warning.dumpSmap"));
}
}
}
String genCharArray = getProperty("genStrAsCharArray");
if (genCharArray != null) {
if (genCharArray.equalsIgnoreCase("true")) {
this.genStringAsCharArray = true;
} else if (genCharArray.equalsIgnoreCase("false")) {
this.genStringAsCharArray = false;
} else {
if (log.isWarnEnabled()) {
log.warn(Localizer.getMessage("jsp.warning.genchararray"));
}
}
}
String errBeanClass = getProperty("errorOnUseBeanInvalidClassAttribute");
if (errBeanClass != null) {
if (errBeanClass.equalsIgnoreCase("true")) {
this.errorOnUseBeanInvalidClassAttribute = true;
} else if (errBeanClass.equalsIgnoreCase("false")) {
this.errorOnUseBeanInvalidClassAttribute = false;
} else {
if (log.isWarnEnabled()) {
log.warn(Localizer.getMessage("jsp.warning.errBean"));
}
}
}
String ieClassId = getProperty("ieClassId");
if (ieClassId != null) {
this.ieClassId = ieClassId;
}
final String targetVM = getProperty("compilerTargetVM");
if (targetVM != null && !AUTOMATIC_VERSION.equalsIgnoreCase(targetVM) ) {
this.compilerTargetVM = targetVM;
}
this.setProperty("compilerTargetVM", this.compilerTargetVM);
final String sourceVM = getProperty("compilerSourceVM");
if (sourceVM != null && !AUTOMATIC_VERSION.equalsIgnoreCase(sourceVM) ) {
this.compilerSourceVM = sourceVM;
}
this.setProperty("compilerSourceVM", this.compilerSourceVM);
String javaEncoding = getProperty("javaEncoding");
if (javaEncoding != null) {
this.javaEncoding = javaEncoding;
}
String fork = getProperty("fork");
if (fork != null) {
if (fork.equalsIgnoreCase("true")) {
this.fork = true;
} else if (fork.equalsIgnoreCase("false")) {
this.fork = false;
} else {
if (log.isWarnEnabled()) {
log.warn(Localizer.getMessage("jsp.warning.fork"));
}
}
}
String xpoweredBy = getProperty("xpoweredBy");
if (xpoweredBy != null) {
if (xpoweredBy.equalsIgnoreCase("true")) {
this.xpoweredBy = true;
} else if (xpoweredBy.equalsIgnoreCase("false")) {
this.xpoweredBy = false;
} else {
if (log.isWarnEnabled()) {
log.warn(Localizer.getMessage("jsp.warning.xpoweredBy"));
}
}
}
// Setup the global Tag Libraries location cache for this
// web-application.
this.tldLocationsCache = tldLocationsCache;
// Setup the jsp config info for this web app.
this.jspConfig = new JspConfig(servletContext);
// Create a Tag plugin instance
this.tagPluginManager = new TagPluginManager(servletContext);
}