Begin forwarded message:
From: Clinton Krenbrenk <[EMAIL PROTECTED]> Date: June 17, 2004 10:41:31 AM MDT To: [EMAIL PROTECTED] Subject: Website Sample Code Correction
Hello Matt:
Today, I started using displaytag and I want to make you aware of an error on the website. The page in question is:
http://displaytag.sourceforge.net/tut_sources.html
This is the text currently on the website:
----------------------------------------------------------------------- -------------------------------------------------------------------
2) Using dynabeans
see http://jakarta.apache.org/commons/beanutils/api/org/apache/commons/ beanutils/RowSetDynaClass.html
<% Connection con = ...; // just open a connection
Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("SELECT * from table"); RowSetDynaClass resultSet = new RowSetDynaClass(rs, false); stmt.close(); con.close(); request.setAttribute("results", resultSet); %>
<display:table name="requestScope.results" />
----------------------------------------------------------------------- -------------------------------------------------------------------
This sample code does not work correctly. The output of this example looks like this:
----------------------------------------------------------------------- -------------------------------------------------------------------
Rows Name DynaProperties
[EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED],
----------------------------------------------------------------------- -------------------------------------------------------------------
The example should read:
----------------------------------------------------------------------- -------------------------------------------------------------------
<%
rows = new ArrayList();
Connection con = ...; // just open a connection
Statement stmt = con.createStatement(); ResultSet rs = stmt.executeQuery("SELECT * from table"); RowSetDynaClass resultSet = new RowSetDynaClass(rs, false); stmt.close(); con.close(); rows = resultSet.getRows(); request.setAttribute("results", rows); %>
<display:table name="requestScope.results" />
----------------------------------------------------------------------- -------------------------------------------------------------------
I hope this helps,
Clinton Krenbrenk
------------------------------------------------------- This SF.Net email is sponsored by The 2004 JavaOne(SM) Conference Learn from the experts at JavaOne(SM), Sun's Worldwide Java Developer Conference, June 28 - July 1 at the Moscone Center in San Francisco, CA REGISTER AND SAVE! http://java.sun.com/javaone/sf Priority Code NWMGYKND _______________________________________________ displaytag-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/displaytag-user

