Hey Guys-
I am starting on a new web project here at work that I've decided to use Struts2 for. I wrote my last project in straight
JSP with
servlets, and I wanted something a bit more structured this time, with easier form management. I ordered a Struts2 book, but it hasn't come in yet, and in the meantime I've been trying to tinker around with the framework to try to get a feel for it.
I've been trying to make a checkboxlist but I can't seem to get the tag to read my array variable right.
What do I all need to have in my
Java classes to make a variable "readable" by the
Struts tags in JSP?
Right now, I have 2 classes, one (Register) which extends ActionSupport and provides the interface to modifying the Person class from the JSP (or so I gather). In the person class, I have a
String array and a getter for it (no setter, since I just want it to display a few options). When I try to create a checkboxlist, I call:
I get an exception saying that:
tag 'checkboxlist', field 'list', name '
Test List': The requested list key 'personBean.testList' could not be resolved as a collection/array/map/enumeration/iterator type. Example: people or people.{name} - [unknown location].
Am I missing something that's required to access my testList array? It's declared as a String[] and filled in the normal manner.
Here's my Person code (I'm using
http://www.brucephillips.name/blog/index.cfm/2008/10/7/Introduction-toThe-Struts-2-Java-Web-Application-Framework as my basis, and modifying the code):
Thanks for any help you can give me!