Yes, we experienced something similar. It only appeared under Tomcat,
Weblogic was ok. I *think* the issue is that one of the distributions
prior to display tag 1.0 contained a configuration bug. The tld did not
define sortProperty. Not sure what the spec says regarding verifying
property (attribute) definitions... Looks like Weblogic ignored the
missing field and just used normal reflection for the property.
Obviously, Tomcat is a little more strict.
Fix: We fixed the problem by getting a new/distribution - 1.0.
Problem Detail:
---------------------
Configuration at issue includes, in web.xml:
<taglib>
<taglib>
<taglib-uri>displaytag-12</taglib-uri>
<taglib-location>/WEB-INF/displaytag-12.tld</taglib-location>
</taglib>
In the tld that your web.xml references, open it up an check for the
sort property reference. It is likely missing. Here's what it should
look like:
<tag>
<name>column</name>
...
<attribute>
<name>sortProperty</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
<type>java.lang.String</type>
<description>
name of the property in the bean specified in the parent
table tag (via the "name" attribute) which will
be used to sort values in the column. This can be used
when the column body is filled or a decorator is
used and column should sort on undeorated values.
</description>
</attribute>
I mention this only because if you are using a locally built version out
of necessity, you can hack the tld to add the entry.
HTH,
Justin
-----Original Message-----
From: PJ Hyett [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 02, 2005 10:35 AM
To: [email protected]
Subject: Re: [displaytag-user] FW: Unusual request
Justin,
I'm not sure if you caught my post the other day, but my friend has been
getting this error on his box (running in OS X, Tomcat 5.5.4) , except
the same code works fine on mine.
javax.servlet.ServletException: /browse.jsp(53,5) Attribute sortProperty
invalid for tag column according to TLD
We're both are using displaytag-1.0. Here's the code that's calling it:
<display:table name="model.listings" class="list" requestURI=""
id="listing" export="false">
<display:column sortable="true" href="listing.html" paramId="id"
paramProperty="id"
property="shortDesc" titleKey="listing.shortDesc"/>
<display:column sortProperty="price" sortable="true" width="70"
titleKey="listing.price">
<fmt:formatNumber type="currency"
value="${listing.price}"/>
</display:column>
</display:table>
Any help would be great.
Thanks,
PJ
On Wed, 2 Feb 2005 10:26:55 -0800, Justin James
<[EMAIL PROTECTED]> wrote:
> Use sortProperty which hangs off the column tag. The sort property
> can come directly from the data object or can be provided by the
> decorator. In your case, you might want to use a column decorator, and
> add a method "getIdAsInteger()" which converts the String to Integer.
> Then make the sort property for the ID column, idAsInteger. e.g.
>
> <display:column property="id" title="ID" headerClass="sortable"
> sortProperty="idAsInteger" decorator="com.package.IdColunmDecoartor"
> />
>
> HTH,
> Justin
>
> -----Original Message-----
> From: Smith, Thad [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, February 02, 2005 9:50 AM
> To: [email protected]
> Subject: [displaytag-user] FW: Unusual request
>
> I'm new to using displaytag, but am very impressed at how easily and
> powerfully it works. I'm developing an interface to a j2ee app that
> was developed by another company. The problem I'm having is with
> sorting.
>
> I'm required to use the entity beans in the other companies
> application for retrieving the data. I then use your tag library to
> display lists of the data like:
>
> <display:table name="contactList" cellpadding="2" cellspacing="2"
> border="0" defaultorder="ascending" defaultsort="1" sort="list">
> <display:column property="id" title="ID"
> headerClass="sortable" href="ContactView.do" paramId="id"
sortable="true" />
> <display:column property="name" sortable="true" />
> <display:column property="phone1" title="Primary Phone" />
> <display:column property="email" autolink="true" />
> </display:table>
>
> Everything works great, except for the ID column. The problem is that
> the list that gets passed to me by the third party entity bean passes
> the id field as a String, even though it's kept in the database as an
> integer (specifically a Numeric type which can handle floats, but the
> ids get generated from a sequence...hence an integer).
>
> This presents a problem since sorting Strings sorts 4000 before 32. Is
> there any way I can convert the value to an integer to be used as the
> sorting value?
>
> Regards,
>
> Thad Smith
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IntelliVIEW -- Interactive
> Reporting Tool for open source databases. Create drag-&-drop reports.
> Save time by over 75%! Publish reports on the web. Export to DOC, XLS,
> RTF, etc. Download a FREE copy at
> http://www.intelliview.com/go/osdn_nl
> _______________________________________________
> displaytag-user mailing list [email protected]
> https://lists.sourceforge.net/lists/listinfo/displaytag-user
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IntelliVIEW -- Interactive
> Reporting Tool for open source databases. Create drag-&-drop reports.
> Save time by over 75%! Publish reports on the web. Export to DOC, XLS,
> RTF, etc. Download a FREE copy at
> http://www.intelliview.com/go/osdn_nl
> _______________________________________________
> displaytag-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/displaytag-user
>
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time by
over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
displaytag-user mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-user
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
displaytag-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/displaytag-user