JSPs specific Web container custom properties



Overview

Custom web container properties are extensions default web container configuration.


com.ibm.wsspi.jsp.allowjspoutputelementmismatch

CTS requirements in previous releases was not applicable to the product, therefore the JSP container supported multiple occurrences of properties in the jsp:output element. In the current release, CTS compliance requires that the JSP container strictly enforces rules about multiple occurrences of properties in the jsp:output element. Use this property to relax the enforcement of the rule for backward compatibility.

Name Value
com.ibm.wsspi.jsp.allowjspoutputelementmismatch true


com.ibm.wsspi.jsp.allowtaglibprefixusebeforedefinition

CTS compliance requires that a tag library directive that defines a prefix must occur before that prefix is used in a custom tag. Because CTS requirements in previous releases were not required, this rule was not enforced. Use this property to relax the enforcement of the rule for backward compatibility.

Name Value
com.ibm.wsspi.jsp.allowtaglibprefixusebeforedefinition true


com.ibm.wsspi.jsp.allowtaglibprefixredefinition

CTS compliance requires that if a tag library prefix is already defined with a different URI within a JSP, WAS must create a translation error. Because CTS requirements in previous releases were not required, this rule was not enforced. Use this property to relax the enforcement of the rule for backward compatibility.

Name Value
com.ibm.wsspi.jsp.allowtaglibprefixredefinition true


com.ibm.wsspi.jsp.allowunmatchedendtag

In version 5 of WAS ND, improper termination of end tags was ignored whereas in version 6, a translation exception is created. This change of behavior in version 6 causes problems to users who are migrating their applications, which had improperly terminated end tags, to version 6. In version 6, to facilitate migration, a WebContainer property, com.ibm.wsspi.jsp.allowunmatchedendtag, and a JSPAttribute, allowUnmatchedEndTag),are provided. Enabling these properties provides the version 5 behavior.

Name Value
com.ibm.wsspi.jsp.allowunmatchedendtag true


com.ibm.wsspi.jsp.userepeatint

The custom property com.ibm.wsspi.jsp.userepeatint ....

Name Value
com.ibm.wsspi.jsp.userepeatint true


com.ibm.wsspi.jsp.usescriptvardupinit

The code generated for a JSP file assumed that the same tag variables to be declared twice in an If-Else condition even if the variable had a 'page' scope. Use this property to enable the feature for all the applications deployed on a server. If the compatibility feature is required only for a specific application then the JSPAttribute useScriptVarDupInit needs to be enabled. If both the options are set then the JSPAttribute takes preference over the webcontainer property.

Name Value
com.ibm.wsspi.jsp.usescriptvardupinit true


com.ibm.wsspi.jsp.usestringcast

Add a 'String cast' to the relative path before inclusion when you migrate version 5.1 applications. In version 6.0.x, the generated Java source for the JSP file did not add the "implicit" cast, for return types of type String when the request.getAttribute method is called. When a JSP file includes a resource whose relative path does not evaluate to a String, then the include fails as the include takes only a String as a relative path of the resource. This property can affect all deployed applications, or we can set as a JSPAttribute, useStringCast, in the extensions file, which affects only the application for which the property is set.

Name Value
com.ibm.wsspi.jsp.usestringcast true


com.ibm.wsspi.jsp.usecdatatrim

Use the com.ibm.wsspi.jsp.usecdatatrim custom property to trim the text before creating CDATA section which eliminates the extra whitespaces added

Users Affected: WebSphere Application Server version 6 users who are migrating their applications from version 5 to version 6 and whose JSPs make use of nesting tags in separate lines.

Problem Description: JSPs that make use of nesting tags have extra lines in the code generated for this section. In version 6, you could eliminate the extra spaces by appending all the lines into one as in: '' The extra line is added in the Java code generated because the text is not trimmed before creating the CDATA section. Therefore, a switch is provided to enable the trimming of the text before creating the CDATA section. We can set the JSP attribute, useCDataTrim, at the Web module level or set the com.ibm.wsspi.jsp.usecdatatrim Web container property at the Web container level using the following name-value pair.

Name Value
com.ibm.wsspi.jsp.usecdatatrim


com.ibm.ws.jsp.getparameterreturnemptystring

Return an empty string for actions not set in a JSP file. If a JSP file contains an action and that property has not been set, the JSP engine returns null on WAS versions 6.0 and 6.1. However, in WAS version 5.1 an empty string is returned. This custom property was added to provide backwards compatibility. When it is set to true, the value returned on a call to jsp:getProperty is an empty string instead of null for versions 6.0 and 6.1.

Name Value
com.ibm.ws.jsp.getparameterreturnemptystring true


com.ibm.wsspi.jsp.evalquotedandescapedexpression

Compile functions that contain an expression. The JSP translation code was modified to handle escape characters and quotations properly when determining whether to evaluate an expression or to treat it as a literal string. To apply this behavior globally across all Web apps, add the following name-value pair as a Web container custom property.

Name Value
com.ibm.wsspi.jsp.evalquotedandescapedexpression true

To enable this new behavior for a single application, also add the evalquotedandescapedexpression JSP attribute to the ibm-web-ext.xmi file of the failing application and set the value to true.

An example entry is:

<jspAttributes xmi:id="JSPAttribute_1" name="evalquotedandescapedexpression" value="true"/>
The attribute id value must be unique.


com.ibm.ws.jsp.jdksourcelevel

Set the JDK source level through the admin console. A JSP engine parameter can be configured for different levels of JDK, but this requires set the jdksourcelevel JSP attribute in the Web extension file for each Web module. However, we can use the com.ibm.ws.jsp.jdkjdksourcelevel custom property to set the JSP attribute globally using the Web container custom property. If this attribute is also defined in the Web extension file, the property defined in the Web extension file supersedes the custom property for that particular application. This custom property is not case sensitive.

The default value is 13.

Name Value
com.ibm.ws.jsp.jdksourcelevel 13, 14, or 15


com.ibm.wsspi.jsp.recompilejsponrestart

This property forces JSPs that were compiled at runtime to be recompiled every time the application is restarted. This is helpful if we switch the underlying JSF implementation. Is best used on development environments.

Name Value
com.ibm.wsspi.jsp.recompilejsponrestart true


com.ibm.wsspi.jsp.modifyPageContextVariable

During the translation phase of a tag file that is compiled, the JSP container implicitly uses the pageContext variable for the PageContext object. The use of the pageContext variable as an implicit variable name in tag files does not comply with the JSP Specification.

If compilation errors occur for applications that use a local pageContext variable in their tag file, set this property to true to remove the use of the pageContext variable name in the generated Java code for tag files.


See

  1. JSP engine configuration parameters
  2. Web container custom properties
  3. JSP custom properties
  4. com.ibm.wsspi.jsp.modifyPageContextVariable