S
Steve
In the following code, why it prints "LOGIC: EMPTY" on the console? I
expect to see "LOGIC: NOT EMPTY" since ss is not null, and it should
pass the test <logic:notEmpty name="ss">. What I am missing here?
Please advice. Thanks!!
<%
String ss = "JJ";
System.out.println("from jsp = " + ss);
%>
<%
if (ss == null)
System.out.println("SS = null");
else
System.out.println("SS != null");
%>
<logic:empty name="ss">
<% System.out.println("LOGIC: EMPTY " ); %>
</logic:empty>
<logic:notEmpty name="ss">
<% System.out.println("LOGIC: NOT EMPTY " ); %>
</logic:notEmpty>
<c:if test="ss != null}">
<% System.out.println("JSTL LOGIC: NOT EMPTY " ); %>
</c:if>
output
==========
[8/9/06 16:19:57:470 PDT] 7d42a949 SystemOut O from jsp = JJ
[8/9/06 16:19:57:470 PDT] 7d42a949 SystemOut O SS != null
[8/9/06 16:19:57:470 PDT] 7d42a949 SystemOut O LOGIC: EMPTY
[8/9/06 16:19:57:470 PDT] 7d42a949 SystemOut O JSTL LOGIC: NOT
EMPTY
expect to see "LOGIC: NOT EMPTY" since ss is not null, and it should
pass the test <logic:notEmpty name="ss">. What I am missing here?
Please advice. Thanks!!
<%
String ss = "JJ";
System.out.println("from jsp = " + ss);
%>
<%
if (ss == null)
System.out.println("SS = null");
else
System.out.println("SS != null");
%>
<logic:empty name="ss">
<% System.out.println("LOGIC: EMPTY " ); %>
</logic:empty>
<logic:notEmpty name="ss">
<% System.out.println("LOGIC: NOT EMPTY " ); %>
</logic:notEmpty>
<c:if test="ss != null}">
<% System.out.println("JSTL LOGIC: NOT EMPTY " ); %>
</c:if>
output
==========
[8/9/06 16:19:57:470 PDT] 7d42a949 SystemOut O from jsp = JJ
[8/9/06 16:19:57:470 PDT] 7d42a949 SystemOut O SS != null
[8/9/06 16:19:57:470 PDT] 7d42a949 SystemOut O LOGIC: EMPTY
[8/9/06 16:19:57:470 PDT] 7d42a949 SystemOut O JSTL LOGIC: NOT
EMPTY