+

Search Tips   |   Advanced Search

JavaServer Pages specific web container custom properties

We can configure name-value pairs of data, where the name is a property key and the value is a string value we can use to set internal system configuration properties. We can define a new property to configure a setting beyond what is available in the administrative console.

Use the following JSP file-specific web container custom properties. The JavaServer Pages custom properties are case-sensitive.

  • Modify the default web container configuration
  • JSP engine configuration parameters
  • Web container custom properties
  • IBM Bindings and Extensions Conversion Tool for Multi-Platforms.


    com.ibm.ws.jsp.getparameterreturnemptystring

    Use this custom property to facilitate the migration of v5.1 applications.

    If a JSP file contains an action that is not set in a JSP file, the JSP engine returns null. In v5.1, if a JSP file contains an action that is not set in a JSP file, the JSP engine returned an empty string. If we need the applications to continue returning an empty string, add this property to your JSP settings and set it to true. When this property is set to true, the value returned on a call to jsp:getProperty is an empty string instead of null.

    Name

    com.ibm.ws.jsp.getparameterreturnemptystring

    Value

    Boolean


    com.ibm.ws.jsp.jdksourcelevel

    Set the JDK source level through the administrative console.

    A JSP engine parameter can be configured for different levels of JDK. However, setting a JSP parameter requires that we set the jdksourcelevel JSP attribute in the web extension file for each web module. However, we can use the com.ibm.ws.jsp.jdksourcelevel 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 is 17.

    Name

    com.ibm.ws.jsp.jdksourcelevel

    Value

    13, 14, 15, 16, 17, or 18


    com.ibm.wsspi.jsp.allowjspoutputelementmismatch

    CTS requirements in previous releases were 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 the com.ibm.wsspi.jsp.allowjspoutputelementmismatch custom property to relax the enforcement of the rule for compatibility with earlier versions.

    Name

    com.ibm.wsspi.jsp.allowjspoutputelementmismatch

    Value

    Boolean


    com.ibm.ws.jstl.allowLenientDateParsing

    Some applications include the JSTL fmt:parseDate tag to parse a date and time. For example:

    <fmt:parseDate value="20070311 02:00:00 AM" 
    var="myTestDate" 
    type="date" 
    pattern="yyyyMMdd HH:mm:ss a" /> 
    

    If the date and time being parsed falls within daylight savings hours, the following exception occurs:

    java.text.ParseException: Unparseable date: "20070311 02:00:00 AM" 
    at java.text.DateFormat.parse(DateFormat.java:349) at 
    org.apache.taglibs.standard.tag.common.fmt.ParseDateSupport.doEn dTag(ParseDateSupport.java:178) 
    at com.ibm._jsp._testDate._jspx_meth_fmt_parseDate_0(_jstlDate.java :123)
    at com.ibm._jsp._testDate._jspService(_jstlDate.java:86) ... 28 more  
    

    To allow more lenient parsing of the date when using the parseDate tag in a specific application, add the com.ibm.ws.jstl.allowLenientDateParsing property as a context parameter to the web.xml file for that application and set this parameter to true.

    Following is an example of how to specify this property as a context parameter in a web.xml file:

    <context-param>
    <param-name>com.ibm.ws.jstl.allowLenientDateParsing</param-name>
    <param-value>true</param-value>
    </context-param>
    

    Because this property must be set for a specific application, it must be specified as a context parameter. This property is ignored if it is specified as a custom property.


    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. This rule was not enforced in previous releases because CTS requirements were not required. However, we can use the com.ibm.wsspi.jsp.allowtaglibprefixusebeforedefinition custom property to relax the enforcement of the rule for compatibility with earlier versions.

    Name

    com.ibm.wsspi.jsp.allowtaglibprefixusebeforedefinition

    Value

    Boolean


    com.ibm.wsspi.jsp.allowtaglibprefixredefinition

    CTS compliance requires that if a tag library prefix is already defined with a different URI within a JSP, the product must create a translation error. This rule was not enforced in previous releases because CTS requirements were not required. However, we can use the com.ibm.wsspi.jsp.allowtaglibprefixredefinition custom property to relax the enforcement of the rule for compatibility with earlier versions.

    Name

    com.ibm.wsspi.jsp.allowtaglibprefixredefinition

    Value

    Boolean


    com.ibm.wsspi.jsp.allowunmatchedendtag

    Use this custom property to facilitate the migration of v5.1 applications.

    When an improper termination of end tags occurs, a translation exception is created. In Version 5.1 of the product, improper termination of end tags was ignored. If we are migrating applications from v5.1 that have improperly terminated end tags, we can add this custom property to the web container settings, and set it to true if we want do not want a translation exception to be issued when an improper termination of end tags occurs.

    When true, this functionality is enabled for all applications in the server. To enable this functionality for a specific application, specify the JSPAttribute allowUnmatchedEndTag, in the extensions file for that specific application.

    Name

    com.ibm.wsspi.jsp.allowunmatchedendtag

    Value

    Boolean


    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 applications, add the following name-value pair as a web container custom property.

    Name

    com.ibm.wsspi.jsp.evalquotedandescapedexpression

    Value

    Boolean

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

    The following example code shows the attribute in an XMI format:

    &ltjspAttributes xmi:id="JSPAttribute_1" name="evalquotedandescapedexpression" value="true"/>
    

    The attribute ID value must be unique.

    The following example code shows the attribute in the ibm-web-ext.xml file:

    <?xml version="1.0" encoding="UTF-8"?>
    <web-ext
    	xmlns="http://websphere.ibm.com/xml/ns/javaee"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://websphere.ibm.com/xml/ns/javaee http://websphere.ibm.com/xml/ns/javaee/ibm-web-ext_1_0.xsd"
    	version="1.0">
    	<jsp-attribute name="evalquotedandescapedexpression" value="true" />
    
    	<reload-interval value="3"/>
    	<auto-encode-requests value="true"/>
    	<auto-encode-responses value="true"/>
    	<enable-directory-browsing value="true"/>
    	<enable-file-serving value="true"/>
    	<pre-compile-jsps value="true"/>
    	<enable-reloading value="true"/>
    	<enable-serving-servlets-by-class-name value="true" />	
    
    </web-ext>
    

    Use an assembly tool, such as Rational Application Developer, to modify IBM extension and binding files. We can convert extension and binding files within modules from XMI to XML using the IBM Bindings and Extensions Conversion Tool for ulti-Platforms.bprac

    For IBM extension and binding files, the .xmi or .xml file name extension is different depending on whether we are using a pre-Java EE 5 application or module or a Java EE 5 or later application or module. An IBM extension or binding file is named ibm-*-ext.xmi or ibm-*-bnd.xmi where * is the type of extension or binding file such as app, application, ejb-jar, or web. The following conditions apply:

    • For an application or module that uses a Java EE version prior to version 5, the file extension must be .xmi.

    • For an application or module that uses Java EE 5 or later, the file extension must be .xml. If .xmi files are included with the application or module, the product ignores the .xmi files.

    However, a Java EE 5 or later module can exist within an application that includes pre-Java EE 5 files and uses the .xmi file name extension.

    The ibm-webservices-ext.xmi, ibm-webservices-bnd.xmi, ibm-webservicesclient-bnd.xmi, ibm-webservicesclient-ext.xmi, and ibm-portlet-ext.xmi files continue to use the .xmi file extensions.


    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 the com.ibm.wsspi.jsp.modifyPageContextVariable custom property to true to remove the use of the pageContext variable name in the generated Java code for tag files.

    Name

    com.ibm.wsspi.jsp.modifyPageContextVariable

    Value

    Boolean


    com.ibm.wsspi.jsp.recompilejsponrestart

    This property forces JSP files that were compiled at run time to be recompiled every time the application is restarted. This property is helpful if you switch the underlying JSF implementation. This property is best used on development environments.

    Name

    com.ibm.wsspi.jsp.recompilejsponrestart

    Value

    Boolean


    com.ibm.wsspi.jsp.usecdatatrim

    Use this custom property to facilitate the migration of v5.1 applications.

    If our JSP files include nesting tags on separate lines, extra lines appear in the Java code generated for those sections of the JSP files. The extra lines are added in the generated Java code because the text is not trimmed before creating the CDATA section.

    We can eliminate the extra lines if we use the double quotation mark (") to append all the lines into a single line, or if we use this property to enable the trimming of the text before the CDATA section is created. Trimming the text before the CDATA section is created eliminates the extra white spaces in the generated Java code.

    When this property is added to the web container settings, and set to true, this functionality is enabled for all applications in the server. To enable this functionality for a specific application, specify the JSPAttribute, useCDataTrim, for that specific in the extensions file for that specific application.

    Name

    com.ibm.wsspi.jsp.usecdatatrim

    Value

    Boolean


    com.ibm.wsspi.jsp.usescriptvardupinit

    The code generated for a JSP file assumed that the same tag variables to be declared two or more times in an If-Else condition, even if the variable had a page scope. The com.ibm.wsspi.jsp.usescriptvardupinit custom property enables this feature for all the applications deployed on a particular server. If the compatibility feature is required only for a specific application, enable the useScriptVarDupInit JSP attribute. If both the options are set, then the JSP attribute takes preference over the web container custom property.

    Name

    com.ibm.wsspi.jsp.usescriptvardupinit

    Value

    Boolean


    com.ibm.wsspi.jsp.reusepropertygroupconfigoninclude

    For transitioning users: Most properties defined in a JSP property group apply to an entire translation unit, for example, the requested JSP file that is matched by its URL pattern and all the files it includes using the include directive. The exceptions are the page-encoding and is-xml properties, which apply separately to each JSP file that is matched by its URL pattern. To revert the behavior to a setting before WAS v9.0, set the custom property to true to apply the two property values to the entire translation unit.trns

    Name

    com.ibm.wsspi.jsp.reusepropertygroupconfigoninclude

    Value

    false


    com.ibm.wsspi.jsp.usestringcast

    Use this custom property to facilitate the migration of v5.1 applications.

    The generated Java source for a JSP file does 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, the include fails because the include takes only a String as a relative path of the resource. This behavior is different than the behavior in v5.1.

    If we are migrating v5.1 applications that include the request.getAttribute method, we can add this property to the web container settings and set it to true. When set to true the JSP compiler explicitly adds a 'String cast' to the relative path of a resource before the inclusion.

    When this property is added to the web container settings, and set to true, this functionality is enabled for all applications in the server. To enable this functionality, specify the useStringCast JSPAtrribute in the extensions file for the specific application.

    Name

    com.ibm.wsspi.jsp.usestringcast

    Value

    Boolean