The following works but I was wondering if there is an easier way?
<html:form action="/GetCategory"
name="categoryForm"
type="com.CategoryForm"
scope="request" >
<html:select property="category" size="1">
<html:option value="Category">Select-A-Category</html:option>
<html:option value="FormA">Form A</html:option>
<html:option value="FormB">Form B</html:option>
<html:option value="FormC">Form C</html:option>
</html:select>
<html:submit />
</html:form></td>
//In my action
String target = new String(request.getParameter("category"));
//In my action form
public class CategoryForm extends ActionForm {
protected String category;
public void setCategory(String category) {
this.category = category;
}
public String getCategory() {
return category;
}
//Now the ugly part in my STRUTS-CONFIG:
<action path="/GetCategory"
type="com.childrencare.GetCategoryAction"
name="categoryForm"
scope="request"
input="/useradminpage.jsp"
validate="false" >
<set-property property="loginRequired" value="false"/>
<forward name="FormA" path="/formA.jsp"/>
<forward name="FormB" path="/formB.jsp"/>
<forward name="FormC" path="/formC.jsp"/>
</action>
Is there an easier way? Doesn't seem right to define multiple fowards in the
struts-config.
Thanks,
Barry