jQuery in Action, 3rd edition
The moose likes Struts and the fly likes Displaytag checkbox using struts2 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Displaytag checkbox using struts2" Watch "Displaytag checkbox using struts2" New topic

Displaytag checkbox using struts2

Joel Sand

Joined: Feb 25, 2009
Posts: 8

I have installed struts2.0.11 clean with maven2 and added the displaytag 1.2 dependency in pom.xml (and also the filters in web.xml).
Printing tables work perfectly well until I try to use the decorators which are used for posting form values with checkboxes as in this example at displaytag.sourceforge.net.
The error I receive when I'm running the homepage is the following:

The controller is returning a RowSetDynaClass, accounts to the jsp (PrintUsers.jsp) which looks like this:

I'd be happy to provide you with whatever information you need in order to help me out here.

Thanks in advance!
Joel S
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63534

Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.

[Asking smart questions] [About Bear] [Books by Bear]
David Newton

Joined: Sep 29, 2008
Posts: 12617

Readable JSP might help :p

Have you tried with a recent version of S2?
Joel Sand

Joined: Feb 25, 2009
Posts: 8
Hi David,

thanks for the quick reply!
(the jsp code should be fixed now)
I've also tried with Struts 2.1.6 but this gives me exactly the same error.

Joel Sand

Joined: Feb 25, 2009
Posts: 8
Ok, I solved it!
The displaytag decorator is looking for a DynaBean named "id" in the RowSetDynaBean table. (I'd guess to have something to sort the rows by)
So after I had added an id to the account table it stopped complaining, case closed!

I agree. Here's the link: http://aspose.com/file-tools
subject: Displaytag checkbox using struts2
It's not a secret anymore!