Hey all,  a few questions about getting started with a form in Struts 2.

Questions
---------
 The scenario: an action generates a form (from a
dynamically-generated list of questions, called a Survey), that's then
submitted.

 I have a class, QuestionGeneratorAction, with two methods:
   - quesionGroups() which generates a survey to fill out
   - saveSurvey() which saves the survey.

 Will the form submit to saveSurvey hit the same instance of
QuestionGeneratorAction as the one that generated the survey
originally?  If not:
   - Can I make it do that?
      - I'm using Spring in my project (but not for this part -- just
DAOs for now), can that help?
   - If not, where can I store the generated survey?
   - Am I missing the whole point of this?

 If it does already, then how do I get a <s:radio> to eventually
result in a call to Response.setValue(int)?  (see Background, below).

Background
----------

The survey's a field in QuestionGeneratorAction, an instance of a
class called Survey, which just has a list of ResponseGroups, which in
turn has a list of Responses.

 The JSP is this: (severely stripped down)
<s:form action="saveSurvey" theme="iddl" validate="false">
        <s:iterator value="survey.responseGroups">
                <s:iterator value="responses">
                        <s:radio name="value" list="{1,2,3,4}" />
                            <!-- that should hit the 'setValue(int)'
method of Response -->
                </s:iterator>
        </s:iterator>
        <s:submit />
</s:form>

(my custom theme iddl just formats the <s:radio> into a table, the
rest is copied from xhtml).


Thanks in advance for any help!!

--
H. Lally Singh
Ph.D. Candidate, Computer Science
Virginia Tech

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to