You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bill Blackmon <bi...@verizon.net> on 2002/07/31 15:43:57 UTC

Scoped jsp items disappearing after Action.validate()

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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>