my dog learned polymorphism
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
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "iterator and <s:radio /> question" Watch "iterator and <s:radio /> question" New topic

iterator and <s:radio /> question

Jordan Smith
Ranch Hand

Joined: Apr 06, 2008
Posts: 89

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

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
you are a master, David!
I agree. Here's the link:
subject: iterator and <s:radio /> question
It's not a secret anymore!