Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

If

...

you

...

used

...

the

...

nested

...

tags

...

a

...

lot in struts 1.x,

...

you

...

may

...

be

...

surprised

...

to

...

find

...

that

...

there

...

is

...

no equivalent
in Struts 2.

...

Have

...

no fear, it is possible to replicate the functionality in Struts 2.

Action Class :

Code Block
java
java
 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


and in

...

the

...

resulting jsp:

Code Block
xml
xml




<s:form     action="/myaction" >

<!-- ..... ->

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


  <s:hidden    name="beanList[%{#stat.index}].beanID"  value="%{beanID}"  />

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

  <s:select name = "beanList[%{#stat.index}].beanStatus"  list="LVBList" listKey="value" listValue="label"  value="%{beanStatus}"/>

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


on

...

submit

...

I

...

access

...

my

...

List

...

of

...

beans with

Code Block
java
java

 with


List mysubmittedList  = getBeantList() ;

ok