Вопрос

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top