简体   繁体   中英

How to set several action for a unique form using struts 1.3?

I'm developing a simple virtual store for an university project. I'm using struts 1.3. My problem is that I have this:

<action name="ComprarMaisForm" path="/ComprarMais" scope="session" type="com.myapp.struts.ComprarMaisAction"> <forward name="pagar" path="/pago.jsp"/> <forward name="eliminar" path="/vistaCarrito.jsp"/> <forward name="comprarmais" path="/index.jsp"/> </action>

I want to have several actions instead of one. How can I do?

For different type of actions you have to specify different action mappings with different 'paths'

<action path="/goto1" ...> .. </action>
<action path="/goto2" ...> .. </action>

Anyways If You want to have several actions with same name (form-bean name) scope type and forward mappings (probably silly ques), You need the SAME action, just give same action name wherever you want to use it. If any 1 parameter is different you need to specify different <action/> mappings.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM