Subject: Session/Application level items disappearing when validate returns errors to
page
From: "BillB" <[EMAIL PROTECTED]>
===
Hi,
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 bean
which contain a description and ID fields 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 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:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>