You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by "Chen, Gin" <Gi...@tvratings.com> on 2002/03/01 17:24:15 UTC

Empty

Hi all,

	1) Didnt the struts taglib use to have a way to test if a collection
is empty?
	I cant seem to find it anymore.
	I have a bean that contains an ArrayList. I want to Output a message
if that ArrayList is empty. I also want a header if it is notEmpty. I could
use the iterate tag but that would print the header for each iteration of
the tag unless I use some scriptlets to check inside the tag (which defeats
the whole purpose of using taglibs i think).

	2) I am using the equal and notEqual of the logic tag to check for a
constant value. That works fine. However, I would like to use it to match a
value coming from another Bean. Is there a way to do this?
	ex.
	Bean1
		int beanID;
	Bean2
		int beanID;

	how can i do:

	in session:
		mybean1 = Bean1;
		mybean2 = Bean2;

	<logic:equals name="mybean1" property="beanID"
value="mybean2.beanID" scope="session">
	</logic:equals>

	I've tried using the above and also using a bean.write to get the
value of the second bean
	But it seems like unless I start using some scriplets, I cant test a
bean property to another bean property.
-Tim

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>