I'm testing to see if I can use either of the refactored tables to use the
export functionality in a Tiles-based application (doesn't work in 0.8.5
version of displaytag).  While I'm at it, I thought I'd do some comparisons:

1.  Building (cd to project directory, execute "ant"):
    * table-york: built successfully in 9 seconds (w/ some deprecation errors)
[PASS]
    * display09: built successfully in 20 seconds (seem to include Javadocs and
sample app though) [PASS]
    * displaytag (current): doesn't compile out-of-the-box [FAIL]

2.  Ant Script - how descriptive are the tasks ("ant -projecthelp")
    * table-york: targets are listed, but no descriptions [FAIL]
    * display09: not very descriptive [FAIL]
    * displaytag: simple with descriptions [PASS]

    ~ Maybe this one wasn't a good test, eh?

3.  Exporting in Tiles - (deployed display.jar in WEB-INF/lib of my appfuse
application)
    * table-york: error when page first loads:

[ServletException in:/WEB-INF/pages/userList.jsp]
/WEB-INF/pages/userList.jsp(27,0) Unable to load class table' 

    REASON: No .tld file in META-INF of the .jar file (I'm using the following
to declare this taglib:

<%@ taglib uri="http://jakarta.apache.org/taglibs/display"; prefix="display" %>

    WORKAROUND: Copied display.tld to WEB-INF, renamed declaration above and
made an entry in web.xml for this tag.

    RESULT: 'Attribute cellspacing invalid according to the specified TLD' 
    WORKAROUND:  Removed attribute from <display:table>.

    RESULT: 'Attribute cellpadding invalid according to the specified TLD' 
    WORKAROUND:  Removed attribute from <display:table>.

    RESULT: 'Attribute width invalid according to the specified TLD' 
    WORKAROUND:   Removed attribute from <display:column>.

    RESULT: Error page displayed with the following stacktrace:

java.lang.StringIndexOutOfBoundsException: String index out of range: -7 at
java.lang.String.substring(String.java:1444) at
java.lang.String.substring(String.java:1411) at
org.displaytag.HtmlTableView.parseURI(HtmlTableView.java:630) at
org.displaytag.HtmlTableView.getURIParams(HtmlTableView.java:649) at
org.displaytag.HtmlTableView.getSortURI(HtmlTableView.java:722) at
org.displaytag.HtmlTableView.getHeaderTitle(HtmlTableView.java:596) at 

    WORKAROUND: Removed requestURI attribute, which was:

requestURI="<%=request.getContextPath()+thisURL.getPath()%>"

    [FAIL] CSV link does the same as 0.8.5, XML link produces nothing and there
is no Excel link.

I reset the app to it's original state and put display09's .jar file in
WEB-INF/lib.

    * display09

    RESULT: 'Attribute styleClass invalid according to the specified TLD' 
    WORKAROUND:  Removed attribute from <display:table>.

    RESULT: None of my CSS classes work, but the page displays (easily fixed
with styleClass attribute). Same results from export as 0.8.5.


Other notes:  

* I like how display09 has the "number of items found" and export options
outside of the table (rather than nested tables like in 0.8.5).  The top one
should probably be a <div> though, rather than a <span>.

* In table-york, "&" should be escaped with "&amp;" when creating URLs to
display in HTML for XHTML compliance.

So the final result - upgrading to the "next generation" of the displaytag was
easier with display09.  By this, I mean getting the page to display, rather
than getting it to display exactly as before.

Here is the final HTML output from both tables (I don't know where the "d-9732"
stuff comes from).

TABLE-YORK
----------
<table  class="list userList" width="100%" border="0" cellspacing="1"
cellpadding="2">
<tr>
<td width="100%" colspan="4">
<table  class="list userList" width="100%" border="0" cellspacing="1"
cellpadding="2">
<tr class="tableRowAction"><td  class="tableCellAction" align="left"
valign="top">Number of Users: 2, displaying 1 to 2</td>
<td  class="tableCellAction" align="right" valign="top"></td>
</tr>
</table>
</td>
</tr>
<tr class="tableRowHeader"><th  class="tableCellHeader"><a
href="?d-9732-s=3&action=Search&sort=0&page=1&order=asc&d-9732-o=2"
class="tableCellHeader">Username</a></th>
<th  class="tableCellHeader"><a
href="?d-9732-s=3&action=Search&sort=1&page=1&order=asc&d-9732-o=2"
class="tableCellHeader">First Name</a></th>
<th  class="tableCellHeader"><a
href="?d-9732-s=3&action=Search&sort=2&page=1&order=asc&d-9732-o=2"
class="tableCellHeader">Last Name</a></th>
<th  class="tableCellHeader"><a
href="?d-9732-s=3&action=Search&sort=3&page=1&order=asc&d-9732-o=2"
class="tableCellHeader">E-Mail</a></th>
</tr>
<tr class="tableRowOdd"><td  class="tableCell" align="null" valign="top"><a
href="/appfuse/editUser.do?action=Edit&amp;from=list?username=tomcat">tomcat</a></td>
<td  class="tableCell" align="null" valign="top">Tomcat</td>
<td  class="tableCell" align="null" valign="top">User</td>
<td  class="tableCell" align="null" valign="top"><a
href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a></td>
</tr>
<tr class="tableRowEven"><td  class="tableCell" align="null" valign="top"><a
href="/appfuse/editUser.do?action=Edit&amp;from=list?username=mraible">mraible</a></td>
<td  class="tableCell" align="null" valign="top">Matt</td>
<td  class="tableCell" align="null" valign="top">Raible</td>
<td  class="tableCell" align="null" valign="top"><a
href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a></td>
</tr>
<tr>
<td width="100%" colspan="4">
<table  class="list userList" width="100%" border="0" cellspacing="1"
cellpadding="2">
<tr class="tableRowAction"><td  class="tableCellAction" align="left"
valign="top">Number of Users: 2, displaying 1 to 2</td>
<td  class="tableCellAction" align="right" valign="top"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td  class="tableCellAction" align="right" valign="top"colspan="4"><a
href="?view=csv&d-9732-s=3&action=Search&page=1&d-9732-o=2"
>CSV</a>&nbsp;&nbsp;<a
href="?view=xml&d-9732-s=3&action=Search&page=1&d-9732-o=2" >XML</a>&nbsp;</td>
</tr>
</table>

DISPLAY09
---------
<span class="pagebanner">2 items found, displaying all items.</span><span
class="pagelinks"><strong>1</strong></span>
<table cellpadding="0" cellspacing="0">
<thead>
<tr>
<th width="17%">
<a
href="/appfuse/editUser.do?d-9732-s=0&amp;action=Search&amp;d-9732-o=2">Username</a></th>
<th width="20%">
<a
href="/appfuse/editUser.do?d-9732-s=1&amp;action=Search&amp;d-9732-o=2">First
Name</a></th>
<th width="13%">
<a href="/appfuse/editUser.do?d-9732-s=2&amp;action=Search&amp;d-9732-o=2">Last
Name</a></th>
<th width="26%">
<a
href="/appfuse/editUser.do?d-9732-s=3&amp;action=Search&amp;d-9732-o=2">E-Mail</a></th></tr></thead>
<tbody>
<tr class="odd">
<td width="17%">
<a
href="/appfuse/editUser.do?action=Edit&amp;username=tomcat&amp;amp;from=list">tomcat</a></td>
<td width="20%">Tomcat</td>
<td width="13%">User</td>
<td width="26%"><a
href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a></td></tr>
<tr class="even">
<td width="17%">
<a
href="/appfuse/editUser.do?action=Edit&amp;username=mraible&amp;amp;from=list">mraible</a></td>
<td width="20%">Matt</td>
<td width="13%">Raible</td>
<td width="26%"><a
href="mailto:[EMAIL PROTECTED]">[EMAIL PROTECTED]</a></td></tr></tbody></table><div
class="exportlinks">Export options: 
<a href="/appfuse/editUser.do?action=Search&amp;d-9732-e=1"><span class="export
csv">CSV </span></a>| 
<a href="/appfuse/editUser.do?action=Search&amp;d-9732-e=2"><span class="export
excel">Excel </span></a>| 
<a href="/appfuse/editUser.do?action=Search&amp;d-9732-e=3"><span class="export
xml">XML </span></a></div>


Don't know if this will help anyone, but it's a worthy migration comparison I
think.

Matt











__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com


-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
displaytag-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/displaytag-devel

Reply via email to