I have
List<BaseObject> foo

The list is of type BaseObjectImpl

BaseObject has fields:
String a
String b

BaseObjectImpl has fields:
String c
String d

Now I'm in a JSP and want to iterate foo (using <s:iterator>), accessing
fields c and d (inside iterator using <s:property>, for example). How? As
far as Struts knows I'm dealing with BaseObject. Is there a way for me to
cast to BaseObjectImpl without creating a StrutsTypeConverter for every
object I'm extending? In my use case, there will be several and the
temptation is to just define the list with the implementation which foils
reusability patterns (e.g., List<BaseObjectImpl>).

Likewise, what to do when posting back to a field like this:
BaseObject bar  (which has BaseObjectImpl as its implementation) e.g.,
<s:textfield name="bar.c" />


Is there a totally different approach that would be better or is
StrutsTypeConverter the only good answer?

- Eric

Reply via email to