struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Getting property value from bean in a collection into a script variable
Date Wed, 15 Dec 2004 21:01:16 GMT

Hi guys,
I am trying to pull the value from a property in a collection(LinkedList)
stored in the request object and store it in a script variable.  I can
write the property value to the response page using a <bean:write> tag
inside a <logic:iterate> tag, but I can't seem to find a way to get the
value into a script variable.  Below, I tried the <bean:parameter> tag with
no luck (it stores null in the variable lastUpdt).  Any suggestions?  For
collections, do I have to do something more elaborate than using the
bean:parameter tag?

Here's the jsp code.  The collection is stored in the "classmateList"
attribute of the response object.  Within each bean in that collection, I
am trying to take the value of the "lastUpdated" property and store it in
the script variable "lastUpdt".


<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<div style="text-align: justify;">
<logic:iterate id="cmateList" name="classmateList">
String updatedFlag = "";
<bean:parameter id="lastUpdt" name="lastUpdated" value=""/>
lastUpdated: <%=lastUpdt%><br>
if (lastUpdt == "" || lastUpdt == "0000-00-00") {
    updatedFlag = "&nbsp;&nbsp;&nbsp";
else {
    updatedFlag = "* ";
name="cmateList" property="firstName"/>&viewLastName=<bean:write
name="cmateList" property="lastName"/>><bean:write name="cmateList"
property="firstName"/> <bean:write name="cmateList"
<div style="text-align: center; color: rgb(0, 0, 102);">
    <html:form action="/BuildHomeViewAction">
        <html:submit value="Return to Your Home Page"/>

"NOTICE:  The information contained in this electronic mail transmission is
intended by Convergys Corporation for the use of the named individual or
entity to which it is directed and may contain information that is
privileged or otherwise confidential.  If you have received this electronic
mail transmission in error, please delete it from your system without
copying or forwarding it, and notify the sender of the error by reply email
or by telephone (collect), so that the sender's address records can be

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message