you can also have two separate action classes that use the same form, where
you use the first action class when you first go into that page, then use
the second when you are submitting or whatever in the form

-----Original Message-----
From: Luna, Kat [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 07, 2001 7:58 PM
To: [EMAIL PROTECTED]
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] 


-- 
The content of this e-mail is confidential, may contain privileged material
and is intended solely for the recipient(s) named above. If you receive this
in error, please notify Software AG immediately and delete this e-mail.

Software AG (UK) Limited
Registered in England & Wales 1310740
Registered Office: Hudson House, Hudson Way,
Pride Park, Derby DE24 8HS

Reply via email to