You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Barry Volpe <bv...@childrencare.com> on 2003/05/28 21:59:23 UTC

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


Re: Is this question too easy?

Posted by Barry Volpe <bv...@childrencare.com>.
Thanks,
Barry
----- Original Message -----
From: "Mark Galbreath" <ma...@qat.com>
To: "'Struts Users Mailing List'" <st...@jakarta.apache.org>
Sent: Wednesday, May 28, 2003 1:08 PM
Subject: RE: Is this question too easy?


> 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:bvolpe@childrencare.com]
> 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: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
>
>
>
>



---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org


RE: Is this question too easy?

Posted by Mark Galbreath <ma...@qat.com>.
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:bvolpe@childrencare.com] 
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: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org