You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Struts Newsgroup (@Basebeans.com)" <st...@basebeans.com> on 2002/07/31 15:55:02 UTC

Session/Application level items disappearing when validate returns errors to page

Subject: Session/Application level items disappearing when validate returns errors to page
From: "BillB" <bi...@verizon.net>
 ===
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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>