You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

If you used the nested tags a lot, you may be surprised to find that there is no equivelent
in Struts 2. Have no fear though. It is possible to replicate the functionality in Struts 2.
I will fill this out a little more as I go but below is the basic gist of it.

Action Class :

List<MyBean> beanList;
.....getter/setter

in the jsp:

<s:form action="/myaction"

.....

<s:iterator value="beanList" id="beantList" status="stat" >

<s:hidden name="beanList[%

Unknown macro: {#stat.index}

].beanID" value="%

Unknown macro: {beanID}

" />

<!-- yeah, good ol' LabelValueBeans can still be used , just remember to use listKey="value" listValue="label" -->

<s:select name = "beanList[%

].beanStatus" list="LVBList" listKey="value" listValue="label" value="%

Unknown macro: {beanStatus}

"/>

</s:iterator>
...
</s:form>

on submit I access my List of beans with

List mysubmittedList = getBeantList() ;

  • No labels