How to use property attributes on column tags for DisplayTag tables in Freemarker templates?
Geoff Shuetrim <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
I am using the following setup and having some trouble in getting the table
rendering to work
with the DisplayTag library.
Tomcat 6.0.20
Freemarker 2.3.25
Stripes 1.5.1
DisplayTag 1.2
Specifically, I am setting up a list of java.net.URI objects in the data
model (accessible as
actionBean.uris from within Freemarker templates). I am then attempting to
render information
about these URIs using the Displaytag table and column tags.
[@display.table name=actionBean.uris id="table" pagesize=10
requestURI="/browser/search/OtherPage.action"]
[@display.column title="Scheme" ]
${table.scheme}
[/@]
[@display.column title="Host" ]
${table.host}
[/@]
[@display.column title="Path" ]
${table.path}
[/@]
[/@]
When I browse the relevant web page, generated by the Freemarker template,
I get a table showing that there are 40 URIs in the list (as expected) and I
get
the data for all three columns.
Next I try to use the property attribute of the column tag and I run into
trouble.
I have tested the following alternatives for the scheme column but no luck.
[@display.column property=scheme title="Scheme" ]
[@display.column property="scheme" title="Scheme" ]
These two result in nothing being shown in the first column but everything
else rendering fine.
[@display.column property=table.scheme title="Scheme" ]
[@display.column property="table.scheme" title="Scheme" ]
These two result in the following stack trace:
java.lang.NoClassDefFoundError: org/apache/commons/beanutils/NestedNullException
org.displaytag.model.Column.getValue(Column.java:124)
org.displaytag.model.Column.createChoppedAndLinkedValue(Column.java:201)
org.displaytag.model.Column.initialize(Column.java:178)
org.displaytag.render.TableWriterTemplate.writeTableBody(TableWriterTemplate.java:313)
org.displaytag.render.TableWriterTemplate.writeTable(TableWriterTemplate.java:138)
org.displaytag.render.HtmlTableWriter.writeTable(HtmlTableWriter.java:734)
org.displaytag.tags.TableTag.writeHTMLData(TableTag.java:1647)
org.displaytag.tags.TableTag.doEndTag(TableTag.java:1300)
freemarker.ext.jsp.TagTransformModel$TagWriter.endEvaluation(TagTransformModel.java:431)
freemarker.ext.jsp.TagTransformModel$TagWriter.afterBody(TagTransformModel.java:407)
There seem to be a number of similar questions raised on this mailing list,
but
none have suggested a syntax that works.
Thanks in advance for your assistance,
Geoff Shuetrim
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now. http://p.sf.net/sfu/bobj-july
_______________________________________________
FreeMarker-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemarker-user