It's not a secret anymore!*
The moose likes Struts and the fly likes iterator and <s:radio /> question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "iterator and <s:radio /> question" Watch "iterator and <s:radio /> question" New topic
Author

iterator and <s:radio /> question

Jordan Smith
Ranch Hand

Joined: Apr 06, 2008
Posts: 89
hi!

I was half answered in the past and am still stuck.

i have list of qustions, and have to iterate over them. for each one to display the possible answers, and to save what the user have chose.

so i wrote:


1. how can i save what the user chose?
i tried to declare in my action class:
List<String> answer;

but it's null.

I have to know which answers where chosen.

2. <s:property value="%{pos.count}" />. is empty. i would like to display the iterator value like 1,2,3 etc.

How can i do it?
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

The name should use array notation; put the index inside square brackets ([]).

Try %{#pos.count}.
Jordan Smith
Ranch Hand

Joined: Apr 06, 2008
Posts: 89
thanks!!
you are a master, David!
 
 
subject: iterator and <s:radio /> question