You can just use JAVA:
<excludeif property="ac:faxPhoneExtension" match=null>
          Ext. <DISPLAY property="ac:faxPhoneExtension">
 </excludeif>

<% if (ac.getFaxPhoneExtension() == null) { %>
        Ext. <DISPLAY property="ac:faxPhoneExtension">
<% } %>

It's as easy as that...



-----Original Message-----
From:   A mailing list about Java Server Pages specification and
reference [mailto:[EMAIL PROTECTED]] On Behalf Of Dave Ferguson
Sent:   Thursday, April 29, 1999 9:03 PM
To:     [EMAIL PROTECTED]
Subject:        Re: MATCH=null bug in JRun?

I've seen the same thing.  I'm using an ugly work-around where I actually do
the test on the string "null".  Of course, this only works on String objects
and I have to initialize to the string "null" in my beans instead of using
the "null" keyword.

A bigger problem to us has been that JRun does not support nested
<INCLUDEIF> or <EXCLUDEIF> tags.  The result is always a nasty
NullPointerException.  Have you run into that?

Dave F.

Christopher Cobb wrote:

> I am using JRun Pro 2.3 build 141.
>
> I am using an <excludeif> tag in an attempt to exclude the display of a
property which may be null.
>
> My JSP looks like this:
>
> <excludeif property="ac:faxPhoneExtension" match=null>
>          Ext. <DISPLAY property="ac:faxPhoneExtension">
> </excludeif>
>
> which I beleive to be correct JSP.
>
> The code generated by JRun looks like this:
>
> String jsp_include_val0 = null;
> String res0 = JSP.beanVal(ac[jsp_array_idx0],"faxPhoneExtension", "null");
> if(!(res0 == null))
> {
> out.println("");
> out.print("              Ext. ");
> ...
> }
>
> This code looks relatively OK, except that I believe that the final
parameter to the JSP.beanVal() method (in this case "null") represents a
default value to return.  So in effect, if my property is null,
JSP.beanVal() returns "null".
>
> The output I get when the property is null is:
>
> Ext. null
>
> This looks like a bug to me.  Any anticipated fix?
>
> cc

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JSP-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to