In the first page it asks you to choose if you're a
a) new student b) old student c) part time student
if you are "new student" you go through "Registrtion.jsp" -->"OpenAccount.jsp"-->"Course.jsp"
if you're old student, you go thorough "Registration.jsp"-->"Course.jsp"
if you're part time, go through "Registration.jsp"-->"CreditHour.jsp"
I want to create and maintain as few JSP as possible. SO, for "Registration.jsp" page it has 3 possible destinations. I decide to use 3 different "DispathAction" classes for three student types. So I will create the following mapping:
multiple action mappings can be forwarded to 1 jsp.
as written, you're missing the 'parameter' attribute in your action mappings, which is required for DispatchAction to work.
if i were you, i wouldn't use DispatchAction for this since the scenario is rather basic struts. i'd have:
1. <action path="/registration/choose" forward="selectStudentType.jsp"/> . the jsp would contain a form mapped to
2. <action path="/registration/select" name="RegistrationBean" type="com.my.actions.SelectAction"> <forward name="newStudent" path="OpenAccount.jsp"/> <forward name="oldStudent" path="Course.jsp"/> <forward name="partTime" path="CreditHour.jsp"/> </action> . RegistrationBean would contain a 'studentType' form-property (in addition to other registration form-properties or you can also use a separate bean). . the radio button would have the 3 forward names as choices (html:radio name="studentType" value="newStudent" etc.)
3. SelectionAction.execute() would look at the 'studentType' value and findFoward to the value of the 'studentType'
-/a<br />certified slacker...yes, my last name is 'do' - <a href="http://www.luckycouple.com" target="_blank" rel="nofollow">luckycouple.com</a>
You totally ruined the moon. You're gonna hafta pay for that you know. This tiny ad agrees: