Title: Logic-Iterate not finding scope of Bean
I would suggest keeping a hidden property on your form that keeps the state that you are in (ie., 1stTimeQuery, or useQueryResults)...
 
----- Original Message -----
From: Luna, Kat
Sent: Thursday, June 07, 2001 2:57 PM
Subject: Logic-Iterate not finding scope of Bean


Hi all, me again with my afternoon question..


I have a UserAction class that extracts a list of Users from the database and stores them in an ArrayList.  Success from this Action forwards to user.jsp which I want to display the list in table format.  I have:

<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<html:html>
<head><title></title>
</head>
<body>

<table>

  <logic:iterate id="user" name="UserAction" property="userList" type="com.test.User">

        <TR>
        <TD><bean:write name="user" property="username"/></TD>
        <TD><bean:write name="user" property="password"/></TD>
        </TR>

  </logic:iterate>

..etc

but this causes the UserAction to run again (essentially calling the database and building the ArrayList again). Is there a way to have this bean init() when the jsp page loads and then iterate through the ArrayList instead of calling the Action first and then displaying the page?  And if so, do I need to add anything to struts-config.xml to tell the page where to find/identify the UserAction bean?

Thanks,


Kat Luna
Web Developer,
BCE Emergis
[EMAIL PROTECTED]

Reply via email to