You are misunderstanding about how JSTL expression work. If the variable is NULL OR event Not exists c:out will produce NOTHING (Empty). This is a specification of JSTL expression. I don't understand why your WebSphere produce "null". You need to re-check.
For examples:
- if foo == null --> Result is empty
- if foo does not exists --> Result is empty ( No exception )
- if foo is empty --> Of course the result is empty
- if foo is "null" ( String ) ==> the result is null
For your case. If you want to display NULL instead of empty, you need to do like this:
<c:if test="${empty param.foo}">null
</c:if>
<c:if test="${not empty param.foo}">
<c:out value="${param.foo}"/>
</c:if>
OR you can create JSTL function to handle this case:
<tf:outNullOrValue (param.foo) />
The function outNullOrValue like this:
public static String outNullOrValue(String s) {
return s == null ? "null" : s;
}
Of course, you need to create TLD for the function and declare taglib directive in your JSP.