Mauricio,

I think this is what you'd be looking for:

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core"; %>
<c:set var="users" value="${pageContext.users}" />
<c:set var="user" value="${users[0]}" />

I'm pretty sure that arraylists (being that they are collections) in the c: taglib 
will take brackets...
HTH,
Glenn

-----Original Message-----
From: Mauricio T. Ferraz [mailto:[EMAIL PROTECTED]
Sent: Saturday, February 28, 2004 11:02 AM
To: Struts Users Mailing List
Subject: <bean:define> ???


Anybody knows how can I define a script variable with bean define tag or
another, for the first element of a collection???

for example:

<%
 ArrayList users = (ArrayList)pageContext.getAttribute("users");
 User user = users.get(0);
%>

How I do it with tags???

Because I want to get the firt element of a collection, e define it!

Thanks


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

Reply via email to