struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Blackmon" <bill.black...@verizon.net>
Subject Scoped jsp items disappearing after Action.validate()
Date Wed, 31 Jul 2002 13:43:57 GMT
Hi,
Sorry, I posted a similar message earlier but I'm very pressed for time.

I have the following declared at the top of a jsp page:
<%
// THIS SECTION IS NEVER 'SEEN' WHEN PAGE IS RETURNED WITH ERRORS......
 Iterator disciplineListIt = (Iterator)
session.getAttribute("DISCIPLINE_LIST");
Iterator AGPAMemberListIt = (Iterator)
session.getAttribute("AGPA_MEMBER_LIST");
Iterator locationListIt = (Iterator) session.getAttribute("LOCATION_LIST");
Iterator membershipCategoryIt = (Iterator)
session.getAttribute("MEMBERSHIP_CATEGORY_LIST");
%>

These iterators populate different groups of checkboxes and contain beans
which contain a description and ID fields pulled from the database.

I am using the following to fill a group of checkboxes (I know I should be
using some type of  Struts Tag but I haven't gotten that far yet - any
working, complete examples that would duplicate the following would be
greatly appreciated!).

<%
while(disciplineListIt.hasNext()) {
 db = (DisciplineBean) disciplineListIt.next();
 description = db.getDiscipline();
 id = db.getDisciplineID();
 sid = String.valueOf(id);
%>
 <td align="left" width=50%>
  <input type="checkbox" name="selDisciplineList" value="<%= sid %>" > <%=
description %>
 </td>
<%

The output of the above and the returned selDisciplineList in the Action
form are exactly what I want. However, if there are errors when the Action
forms validate method is called, all of the checkbox groups that are created
by the above Iterators are no longer visible. I've tried making copies of
the iterators into Action form items w/set and get methods and its the same
output.

Is this a totally invalid approach using Struts or is there a much more
obvious way that I'm too blind to see
to do what I'm trying to accomplish?

Thanks,
Bill


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


Mime
View raw message