struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Timo Kinnunen" <>
Subject s:bean with s:param inside s:bean doesn't work, jsp:useBean does
Date Fri, 17 Aug 2007 16:56:57 GMT
I produce XML from a jsp page. I'm iterating the results of a DAO. For each
result, I want to use another DAO and iterate over result from that. I'm
declaring the inner DAO using s:bean, but I can't access the loop variable
from inside s:param. If I change the nested DAO declaration to use
jsp:useBean it works as expected. What am I doing wrong? Here's the jsp:

<s:bean name="">
<c:forEach var="curr" items="${allProfiles}">
<link url="${base}/users/${curr.handle}"><c:out value="${curr.nick

<%-- This works:
<jsp:useBean id="message" class=""
<jsp:setProperty name="message" property="page" value="0"/>
<jsp:setProperty name="message" property="pageSize" value="2"/>
<jsp:setProperty name="message" property="handle" value="${curr.handle}"/>

<s:bean name="" id="message">

<%-- This sets null instead of correct value: --%>
<s:param name="handle" value="${curr.handle}"/>

<s:param name="page" value="0"/>
<s:param name="pageSize" value="2"/>

<%-- This shows the value OK: --%>
<test value="${base}" value2="${curr.handle}"/>

<c:forEach var="msg" items="${profileMessages0}">
 ownercomment="${ ==}"
 content="<c:out value="${msg.content}"/>"
 time="<s:text name="users.messages.elapsed">
 <s:param value="${bean.time - msg.created}"/>
 <s:param value="${(bean.time - msg.created) / 1000}"/>
 <s:param value="${(bean.time - msg.created) / 60000}"/>
 <s:param value="${(bean.time - msg.created) / 3600000}"/>
 <s:param value="${(bean.time - msg.created) / 86400000}"/>

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message