You don't specify a value with <logic:present>, you specify a property.  If
it is anything except null (or empty string), it returns true.

-----Original Message-----
From: Sri Sankaran [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 30, 2002 11:25 AM
To: Struts Users Mailing List
Subject: RE: [Taglib] Testing for null value using <logic>


I had looked at it but passed up on it because the documentation reads

  Generate the nested body content of this tag if the specified value is not
present in this request. 

The property I am testing is not in the request.  It is in the session.

Am I reading to literally?

Sri

-----Original Message-----
From: Eddie Bush [mailto:[EMAIL PROTECTED]] 
Sent: Friday, August 30, 2002 11:21 AM
To: Struts Users Mailing List
Subject: Re: [Taglib] Testing for null value using <logic>


You should look at <logic:present .../> and <logic:notPresent .../>

Sri Sankaran wrote:

>Using Struts 1.0.2 on Tomcat 4.0.2
>
>I see that the <logic:empty> is only available in Struts 1.1
>
>How does one test for a null value using Struts 1.0 tags?
>
><logic:equal property="foo" value="<%=null%>">
>   <%-- do something --%>
></logic:equal>
>
>will not work since deep in the bowels of the <logic:equal> it does a 
>value.length() and barfs on the null.
>
>An ugly workaround is for the form bean to have an isNull() method for 
>the property foo.
>
>Sri
>



--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to