Comments embedded below.

> From: Keith Bacon [mailto:[EMAIL PROTECTED]]
> Subject: RE: bean comparison using tags
> 
> Thinking about this I suspect the esteemed designers of 
> struts think you shouldn't want to do
> this!
> It means you are putting logic in the jsp that should be in 
> the Action class (or even the business
> logic). example:-
> 
> for Cust Type = DisplayParm.CustTypOption1  display is in one format
> for others it's the default format.
> In your JSP you want to make the test
> <logic:equals name="customer" property="custType" 
> name2="displayParm" property2="custTypeOption1"
> >  
> 
> The idea is to change this so your action class puts a string 
> called displayType in the request
> so in your jsp you code
> <logic:equal name="displayType" scope="request">
 
I'm not sure I follow you here since you left out the "value" attribute
that is required by logic:equal.  In any case I just figured out the answer
to my original question.  To insert a run-time expression for 
the value of the "value" attribute one has to use single quotes in
conjunction with a scriptlet.  For example, 

   <logic:equal name="b1" property="p1" value='<%= b2 %>'>
     conditional content...
   </logic:equal>

means that the value of the property p1 of bean b1 is compared to
the String value referenced by bean b2.  Without the scriptlet
the value attribute would be bound to the literal String value "b2".  
It seems then that the single quotes are necessary to use a scriptlet
within a call to a custom tag.  

    Nick

> --- "Afshartous, Nick" <[EMAIL PROTECTED]> wrote:
> > > From: Fernando Esteban Barril Otero 
> >  
> > > Try to use the <bean:define> to get the property
> > > of the second bean (b2) first and then use <logic:equal>.
> > > 
> > > <bean:define id="strProp" name="b2" property="p2"/>
> > > 
> > > <logic:equal name="b1" property="p1" value="strProp">
> > >    Yes, the two are equal
> > > </logic:equal>
> > 
> > Thanks but the value attribute is used to specify literal String
> > values.  In the above example value="strProp" specifies the
> > String value "strProp" not a bean named strProp.  
> > All the examples I could find using logic:equal in the 
> example app compare a
> > bean
> > property to a literal String value.
> > 
> > Does anyone know if its possible to do a comparision involving two 
> > beans ?
> > 
> > > ----- Original Message -----
> > > From: "Afshartous, Nick" <[EMAIL PROTECTED]>
> > > To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> > > Sent: Thursday, January 24, 2002 12:39 PM
> > > Subject: bean comparison using tags
> > > 
> > > 
> > > >
> > > > (sorry if this got posted twice).
> > > >
> > > > Hi,
> > > >
> > > > I'm trying to perform an equal test on two String values
> > > > accessed via two beans.  So I'd like to do something like:
> > > >
> > > >   <logic:equal name="b1" property="p1"
> > > >                value="b2"/>
> > > >        Yes, the two are equal
> > > >   </logic:equal>
> > > >
> > > > but it seems that only literal String values may be specified by
> > > > the 'value' attribute.  Does anyone have any 
> suggestions on this ?
> > > > Thanks.
> > > > __
> > > >
> > > >      Nick
> > > >
> > > > --
> > > > 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]>
> 


__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com

--
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