Well, you'd probably have better performance if you got rid of the
</html:submit> tag.... But this looks about as simple as it gets.

Mark

-----Original Message-----
From: Barry Volpe [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 28, 2003 3:59 PM
To: Struts Users Mailing List
Subject: Is this question too easy?


Using an action the following is the method I am using to call forms from a
list box (instead of using links).  Is there an easier way of doing this
possibly without an action?


 <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




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

Reply via email to