This week's book giveaway is in the Big Data forum.
We're giving away four copies of Elasticsearch in Action and have Radu Gheorghe & Matthew Lee Hinman on-line!
See this thread for details.
The moose likes Struts and the fly likes Struts1:  evaluating two conditions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Elasticsearch in Action this week in the Big Data forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts1:  evaluating two conditions" Watch "Struts1:  evaluating two conditions" New topic

Struts1: evaluating two conditions

Mike Fourier

Joined: Apr 02, 2008
Posts: 25

I know java quite well, and I'm from the scriptlet school of JSPs. So I'm a total Struts taglib newb, and I'm puzzled about how to do the following code in Struts taglibs:

Where I have the //1 and //2 are where I'm stuck. How do I say this using taglibs? (I've got all the rest of the code working with taglibs):

Can I check for both !=null and .size>0 in one taglib, and then have a second taglib for the case where it's either .size==0 or size==null ?

[ April 02, 2008: Message edited by: Mike Fourier ]
Brent Sterling
Ranch Hand

Joined: Feb 08, 2006
Posts: 948
You can do this with jstl tags, but if you want to use the Struts tags then it seems that you would want to use logic:empty and logic:notEmpty.

- Brent
jQuery in Action, 2nd edition
subject: Struts1: evaluating two conditions