Only Last row is available in my ArrayList?
Have the following:
ArrayList teachers = new ArrayList();
DynaActionForm teacherForm = (DynaActionForm)form;
while ( rs.next() ) {
System.out.println(firstname.rs: + rs.getString(firstname));
System.out.println(lastname.rs: +
Users Mailing List
Subject: DynaAction form and ArrayList
Only Last row is available in my ArrayList?
Have the following:
ArrayList teachers = new ArrayList();
DynaActionForm teacherForm = (DynaActionForm)form;
while ( rs.next() ) {
System.out.println(firstname.rs: + rs.getString(firstname
while(rs.next()) {
Map teacher = new HashMap();
teacher.put(firstName,rs.getString(firstName));
teacherList.add(teacher);
}
teacherForm.set(teachers, teacherList);
request.setAttribute (teachers, teacherList.toArray());
Cheers Mark
On Monday, November 3, 2003, at 07:35
Per the JavaDoc for RowSetDynaClass:
import org.apache.commons.beanutils.RowSetDynaClass;
...
Connection conn = ...; // Acquire connection from pool
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery(SELECT ...);
RowSetDynaClass rsdc = new RowSetDynaClass(rs);
rs.close();
It works alright but last time i played with these beanutil's toys it
was understandably slow. A little less slower is getting the
resultsetmetadata and using them as your property names.
IMO its better to make some beans and populate them with the result set
values, until you've time to put a
That's just what RowSetDynaClass and the implementation of the Result interface
in JSTL do (use ResultSetMetaData to grab column names).
Quoting Mark Lowe [EMAIL PROTECTED]:
It works alright but last time i played with these beanutil's toys it
was understandably slow. A little less slower is
Thanks Mark
Your suggestion worked.
I did not use the
teacherForm.set(teachers, teacherList);?
It looks like this is accomplished without using
DynaAction Form and using JSTL in my jsp page.
Barry
- Original Message -
From: Mark Lowe [EMAIL PROTECTED]
To: Struts Users Mailing List
Hi all,
I have a java value object (i.e. MyVo) which i add the DynaAction Form
Below. When i display my jsp it works fine using headerVO.firstName but when
i submit the page to save user changes i get the following error:
java.lang.IllegalArgumentException: No bean specified
Subject: DynaAction form - can I use a boolean primitive
From: Matt Raible [EMAIL PROTECTED]
===
When defining my DynaActionForm in struts-config.xml, is this possible:
form-property name=allowBrowsing type=boolean /
--
To unsubscribe, e-mail: mailto:[EMAIL PROTECTED]
For additional
PM
To: [EMAIL PROTECTED]
Subject: DynaAction form - can I use a boolean primitive
Subject: DynaAction form - can I use a boolean primitive
From: Matt Raible [EMAIL PROTECTED]
===
When defining my DynaActionForm in struts-config.xml, is this possible:
form-property name=allowBrowsing
10 matches
Mail list logo