--- Stephen Hood <[EMAIL PROTECTED]> wrote:
> My last message didn't get any hits, so I'll try
> again with a low-verbosity
> filter.  :)
> 
> 1.  Has anyone had any success using JAXB, Castor,
> or any other XML data
> binding technology to auto-generate their Struts
> ActionForm beans from DTDs
> or XML Schemas (not from XML instance data or JSPs,
> like CodeMaker, etc.
> does) ?
I've looked at Castor and it seems nice.  I didn't end
up using it for my project though or using it to
generate ActionForms.

> 
> 2.  Has anyone had any experience dealing with
> complex ActionForms, such as
> those derived from a XML Schema?  It seems like the
> Struts taglibs are more
> about handling relatively flat documents; can anyone
> suggest other
> approaches for doing things like generating and
> handling forms with optional
> repeating groups, etc.?
You can have nested properties if you aren't aware of
that.  So for a property you could have "address.name"
and this would be the equivalent of
getAddress().getName().  ("address[2].name" ->
retrieve object from array and then call getName()) 
So this can let you have different beans nested inside
each other.

Dave Hays has added the functionality of indexed
functionality for tags.  This lets you reference
anything the logic:iterator tag can loop through and
generate the correct indexed property name
dynamically.  It is in the nightly builds or you can
download it here. 
http://www.husted.com/struts/resources/indexed-tags.htm


<logic:iterate id="listElement" name="newsscanForm"
property="listElementList" indexId="index">
    <td align="right" valign="center">
       <html:text indexed="true" name="listElement"
property="position" size="2" maxlength="2"/>
    </td>
</logic:iterate>

public List getListElementList();
public Object getListElement(int index);
public void setListElement(int index, Object value);

David

> 
> I can elaborate if anyone is interested in further
> discussion...
> 
> many thanks,
> --Steve
> 
> 


__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

Reply via email to