Oops, hold that thought. I didn't read my results correctly. You're right, my test.jsp showed both (which is wrong). I'll take a closer look at this.
-- James Mitchell Software Engineer/Struts Evangelist http://www.open-tools.org/ "The man who does not read good books has no advantage over the man who cannot read them." - Mark Twain (1835-1910) > -----Original Message----- > From: James Mitchell [mailto:[EMAIL PROTECTED]] On Behalf > Of James Mitchell > Sent: Wednesday, February 19, 2003 10:56 AM > To: 'Struts Users Mailing List' > Subject: RE: logic:empty and logicnotEmpty with a Collection (again) > > > That doesn't seem right. What version are you using? > > I recently finished cactus tests on the logic tags, and I test exactly > what you've described without failures. > > > In fact, I just tried this in a test.jsp: > <%@ page contentType="text/html;charset=UTF-8" language="java" %> > <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> > <% > java.util.Map emptyMap = new java.util.HashMap(); > pageContext.setAttribute("emptyMap", emptyMap); > %> > <logic:empty name="emptyMap">emptyMap empty</logic:empty><br> > <logic:notEmpty name="emptyMap">emptyMap not > empty</logic:notEmpty><br> > > > > ....works fine. > > You probably forgot to add the taglib declaration: > <%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %> > > If you did not do this, then you will see exactly what you've > described. > > > > -- > James Mitchell > Software Engineer/Struts Evangelist > http://www.open-tools.org/ > > "The man who does not read good books has no advantage over > the man who > cannot read them." > - Mark Twain (1835-1910) > > > > > > > > > -----Original Message----- > > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > > Sent: Wednesday, February 19, 2003 3:11 AM > > To: [EMAIL PROTECTED] > > Subject: logic:empty and logicnotEmpty with a Collection (again) > > > > > > Hi, > > > > I found some behaviour of the logic:notEmpty tag which I think is > > inconsistent. > > > > Reading the documentation, I think it should call a > > collection's isEmpty() > > method. It works as expected with a bean of type List, but it > > doesn't work > > with a Map. > > > > Testcase: > > > > If emptyList was built with > > > > List emptyList = new ArrayList(); > > > > the following fragment correctly states only "emptyList empty": > > > > <logic:empty name="emptyList">emptyList empty</logic:empty><br> > > <logic:notEmpty name="emptyList">emptyList not > > empty</logic:notEmpty><br> > > > > But if I change from emtpyList to > > > > Map emptyMap = new HashMap(); > > > > and test it with > > > > <logic:empty name="emptyMap">emptyMap empty</logic:empty><br> > > <logic:notEmpty name="emptyMap">emptyMap not > > empty</logic:notEmpty><br> > > > > I get > > > > emptyMap not empty > > nonemptyMap not empty > > > > instead of just "emptyMap empty". Both (mutually exclusive) > > statements seem > > to evaluate to true. > > > > So, is this a misunderstanding from my side or a bug in the > > implementation? > > > > TIA > > > > Steffen > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

