You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Delio Dirazar <dd...@intervan.com.ar> on 2003/06/24 22:57:22 UTC

ActionForm bean clear values

Hi:
 I have some random error working width ActionForm's bean. The error is
that some String Array field lost those values traversing pages indeed
theses actionform's bean are defined in session scope.
 I have a workflow with 5 steps. For every step I've one jsp and one
Action Class. 
 The first step works width ActionForm bean called "reservaForm". The
next 2 steps work width the same ActionForm bean called
"pasajePersonasForm". The last 2 steps work width the same ActionForm
bean called "reservaForm". So the workflow works width 2 form beans and
with 5 jspĀ“s pages. All these ActionForm beans are defined in session
scope.

The last action of the last jsp page return the first jsp. 
In the ActionForm bean "reservaForm", there are 2 String arrays whose
values are loaded after the user select some option. So when the
workflow reach the last page and must return the first page, the values
of this 2 string arrays  have null values and give me an exception
"...Property serviciosSalidas has returned a null value". I've put logs
in the setter's an getter's methods of reservaForm Class, and this
methods are not called. 

This errors not allway ocurrs but we can generate frecuently accesing
using Microsoft Proxy Server. 

Could anybody help us ? 


We are using Apache 1.3.12, Tomcat 4.1 and Struts 1.0

Here part of struts.config.xml

...
    <!--
================================================================== -->
    <!-- Acciones Reservar -->
    <!--
================================================================== -->
    <action path="/accionesReservarPaso1"
type="com.intervan.pasajes.AccionesReservarPaso1" name="reservaForm"
scope="session" input="/reservar.jsp">
      <forward name="idem" path="/reservar.jsp"/>
      <forward name="anterior" path="/fr_central.htm"/>
      <forward name="siguiente" path="/reservar2.jsp"/>
      <forward name="siguienteA" path="/reservar2a.jsp"/>
    </action>

    <action path="/accionesReservarPaso2"
type="com.intervan.pasajes.AccionesReservarPaso2"
name="pasajePersonasForm" scope="session" input="/reservar2.jsp">
      <forward name="idem" path="/reservar2.jsp"/>
      <forward name="anterior" path="/reservar.jsp"/>
      <forward name="siguiente" path="/reservar3.jsp"/>
    </action>

    <action path="/accionesReservarPaso2a"
type="com.intervan.pasajes.AccionesReservarPaso2" name="pasajeAutosForm"
scope="session" input="/reservar2a.jsp">
      <forward name="idem" path="/reservar2a.jsp"/>
      <forward name="anterior" path="/reservar.jsp"/>
      <forward name="anteriorA" path="/reservar3.jsp"/>
      <forward name="siguiente" path="/reservar3a.jsp"/>
    </action>

    <action path="/accionesReservarPaso3"
type="com.intervan.pasajes.AccionesReservarPaso3"
name="pasajePersonasForm" scope="session" input="/reservar3.jsp">
      <forward name="idem" path="/reservar3.jsp"/>
      <forward name="anterior" path="/reservar2.jsp"/>
      <forward name="siguiente" path="/reservar4.jsp"/>
      <forward name="siguienteA" path="/reservar2a.jsp"/>
    </action>

    <action path="/accionesReservarPaso3a"
type="com.intervan.pasajes.AccionesReservarPaso3" name="pasajeAutosForm"
scope="session" input="/reservar3a.jsp">
      <forward name="idem" path="/reservar3a.jsp"/>
      <forward name="anterior" path="/reservar2a.jsp"/>
      <forward name="siguiente" path="/reservar4.jsp"/>
    </action>

    <action path="/accionesReservarPaso4"
type="com.intervan.pasajes.AccionesReservarPaso4" name="reservaForm"
scope="session" input="/reservar4.jsp">
      <forward name="idem" path="/reservar4.jsp"/>
      <forward name="anterior" path="/reservar3.jsp"/>
      <forward name="anteriorA" path="/reservar3a.jsp"/>
      <forward name="siguiente" path="/reservar5.jsp"/>
    </action>

    <action path="/accionesReservarPaso5"
type="com.intervan.pasajes.AccionesReservarPaso5" name="reservaForm"
scope="session" input="/reservar5.jsp">
      <forward name="idem" path="/reservar5.jsp"/>
      <forward name="anterior" path="/reservar4.jsp"/>
      <forward name="siguiente" path="/reservar.jsp"/>
    </action>




	

_______________________________________________ 
Lic. Delio Dirazar
Intervan SC. 
Alem 72, (8500) Viedma - Rio Negro - Argentina 
(54)2920-42-6969 
http://www.intervan.com.ar 
mailto:ddirazar@intervan.com.ar 
 
 


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


Re: Forms with dynamically generated fields

Posted by Piers Dunleavy <pd...@ign.com>.
> You can always use mapped properties though.
>
> public String getSomeProperty(String parameter);
> public void setSomeProperty(String parameter, String value);

I take it, however, that there's no way of doing this simply through
DynaActionForm?

-Piers


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


Re: Forms with dynamically generated fields

Posted by Michael Thompson <Mi...@Sun.COM>.
You can always use mapped properties though.

public String getSomeProperty(String parameter);
public void setSomeProperty(String parameter, String value);

<html:text property="someProperty(yourKeyGoesHere)"/>  <!-- note the ()s -->

You might extract your keys from your form and loop over them with a c:forEach or a logic:iterate.

	--m

Piers Dunleavy wrote:
> I have a JSP that generates a form based. The JSP creates a set of input
> fields on fly based on some prior information that the user entered.
> Therefore the number of fields for that form will differ from user to user.
> What is the best approach in Struts for dealing with this. Obviously, I
> can't simply define a DynaActionForm in the struts-config file, for there
> won't be a fixed number of fields.
> 
> -Piers
> 
> ---------------------------------------------------------------------
> 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


Forms with dynamically generated fields

Posted by Piers Dunleavy <pd...@ign.com>.
I have a JSP that generates a form based. The JSP creates a set of input
fields on fly based on some prior information that the user entered.
Therefore the number of fields for that form will differ from user to user.
What is the best approach in Struts for dealing with this. Obviously, I
can't simply define a DynaActionForm in the struts-config file, for there
won't be a fixed number of fields.

-Piers

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