struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Håkon T Sønderland <...@antares.no>
Subject Struts/JSP logic question
Date Mon, 27 Sep 2004 16:32:43 GMT
Hi list,

I have two collections from which I would like to print some
texts to the web-page.  I would like to print one text from the first
collection, then all texts from the second and then the rest from the
first.

So far I have the following JSP code:

<bean:define id="show" value="Yes"/>
<logic:iterate id="bodystring" name="letter" property="body"
  scope="session">
  <tr>
   <td colspan=2 align="left" valign="middle" class="letterplain">
     <%--bean:write name="bodystring" / Not using this because we want
       to be able to embed html tags in the string --%>
     <%=bodystring%>
   </td>
  </tr>
  <logic:equal name="show" value="Yes">
   <logic:iterate id="elems" name="letter" property="elements"
    scope="session">
    <tr>
     <td colspan=2 align="left" valign="middle" class="letterplain">
      <bean:define id="element" name="elems" property="element"/>
      <bean:write name="elems" property="before"/>
      <bean:write name="displayForm" property="<%=element%>"/>
      <bean:write name="elems" property="after"/>
     </td>
    </tr>
   </logic:iterate>
   <% show="No"; %>
  </logic:equal>
</logic:iterate>

This isn't working, the "show" bean isn't set to "No" as I expected.
I need to be able to set the value of the "show"
bean to something so that the logic:equal tag will work, but I'm
completely stumped on how to do that.

I know the answer is probably staring me in the face and I should
be embarrassed not to see it, but still.... ;)

Thanks for any help,
Håkon
-- 
We shall fight on the beaches,
we shall fight on the landing grounds,
we shall fight in the fields and in the streets,
we shall fight in the hills;
we shall never surrender

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message