WLS 10.3.2: Null is not displayed for JSP expressions which evaluate to null even if <print-nulls> is set to false.

(Doc ID 1260426.1)

Last updated on NOVEMBER 05, 2016

Applies to:

Oracle WebLogic Server - Version 10.3.2 to 10.3.5
Information in this document applies to any platform.

Symptoms

On migrating a basic Struts JSP page from WLS 9.2.3 to WLS 10.3.2 it was noticed that Null is not displayed for JSP expressions which evaluate to null even if <print-nulls> is set to false in weblogic.xml file.

<%
List<String> listMsg = new ArrayList<String>();

listMsg.add("Message A");
request.setAttribute("listMsg", listMsg);

Integer myInt=null ;
%>

Outside iterate: myInt=<%= myInt%>
<br>

<logic:iterate name="listMsg" id="elt">
<% boolean myIntB = (myInt == null);
out.println("myIntB = " + myIntB + "</br>");

if (myInt == null) {
out.println("It is null </br>");
}
%>

Inside iterate: myInt=<%= myInt%>
<br>
Inside iterate with String.valueOf: myInt=<%= String.valueOf(myInt)%>
</logic:iterate>


Deploying this JSP page on WLS 10.3.2 has different result then in WLS 9.2.3 as below:

1. In WLS 9.2.3:
Outside iterate: myInt=null
Inside iterate: myInt=null
Inside iterate with String.valueOf: myInt=null

2. In WLS 10.3.2:
Outside iterate: myInt=null
Inside iterate: myInt=
Inside iterate with String.valueOf: myInt=null

Changes

N/A

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms