I'm going to avoid your specific question for a moment to look at the big picture.
Struts is a Model/View/Controller (MVC) framework and one of it's purposes is to make it easy to divide up your logic between view and model components. When you design a Struts application, you need to bear this in mind.
The reason I mention this is that a
JSP is a view component and populating an ArrayList is generally not something you would want to do in a view component.
You should do this in either one of your model classes, or in your Action class. Once the action class has created it and put it in some scope, the JSP can use it.
Now, back to your original questions. You can instantiate a new ArrayList with a <jsp:useBean> tag, but not with a <bean:define> tag. The thing you need to realize, though, is that the <bean:xxx> tags were meant to work only with JavaBeans and ArrayList is
not a JavaBean. Even if you have an instance of it, you can't change it or add to it with <bean:xxx> tags or any other struts tags because it does not follow the JavaBean conventions for naming methods (they don't start with "get" or "set").
I'd suggest instantiating and populating the ArrayList in the action class that forwards to this JSP, and then putting it in request scope.
Regarding your second question, my advice is to not use <logic:xxx> tags at all, but to use JSTL tags instead. JSTL is much more powerful and more a standard part of
Java EE.
JSTL does automatic type conversions, similar to JavaScript, and that would come in handy in your example. Here's how you'd do it in JSTL:
<c:set var="x" value="3" />
<s:set var="y" value="5" />
<c:if test="${x > y}" >do something</c:if>
Note that without JSTL's automatic type conversion, it would do a
String comparison rather than a numeric comparison. In a string comparison, if x is "10" and y is "5", "x > y" would evaluate to false.
[ July 13, 2006: Message edited by: Merrill Higginson ]