You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Maya menon <ma...@yahoo.com> on 2007/08/14 21:49:13 UTC

Struts 1.2 using formbeans

Hi all,
   
  I need some help here.
  I am using Struts 1.2
   
  1. I have inputForm1.jsp where I input 2 values and then fetch the 3rd value using a Submit action. This has been mapped to Submit.do and inputFormBean is referrenced in the struts-config file. 
  Inside action class Submit.do, the 2 input values are read from InputForm and third value is obtained from DB. 
  Then I set this 3rd value to the inputform using setter method and do a mapping.forward("inputForm1.jsp")
   
  However, when inputForm1.jsp gets displayed, all fields are null. No values for 1,2 and for the newly fetched parameter 3. 
  What am I doing wrong ?
   
  Again, I have
  inputForm1.jsp -> SubmitAction->InputFormBean
  In submitAction, I call setter method of formbean and sets the 3rd parameter and do
  mapping.findforward
   
  Thanks,

       
---------------------------------
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. 

Re: Struts 1.2 using formbeans

Posted by Jasper Floor <ja...@gmail.com>.
hmm, I assume the input fields have the same name as the relevant form
properties. Case is important.  Perhaps you need an input parameter in
your action definition. input=inputform.jsp or something along those
lines.

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


Re: Struts 1.2 using formbeans

Posted by Maya menon <ma...@yahoo.com>.
i TRIED SETTING THE REDIRECT=TRUE ALSO, but still it doesnt display the values when coming back to the original window. 
   
  Can this be an issue ?
   
  From inputform, I have a submit button which opens another window and calls submitaction. In the new window I am displaying the 3rd parameter and allowing users to select the parameter they want.
   
  The new ndow[new jsp also] I have added the same action configuration..
   
  Thanks

Maya menon <ma...@yahoo.com> wrote:
  Chris,

Thanks for the reply, I dont have redirect=true
Here is the action:

type="com.test.actions.ListNPAAction" name="InputForm">




Thanks again, 

Christopher Schultz wrote:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Maya,

Maya menon wrote:
> In submitAction, I call setter method of formbean and sets the 3rd
> parameter and do mapping.findforward

Does the forward you are using have redirect="true"? If so, the form
bean might be lost of the form bean is not in session scope.

Can you post the relevant parts of your struts-config.xml? That would be
helpful.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGwhTe9CaO5/Lv0PARAppgAKCdANJE6OJE5V9lBiNOeTk3dJqTRQCgmGQu
WnseD+9z1hsQFLUFaDNeX68=
=Rxup
-----END PGP SIGNATURE-----

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




---------------------------------
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. 

       
---------------------------------
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. 

Re: Struts 1.2 using formbeans

Posted by Maya menon <ma...@yahoo.com>.
Chris,
   
  Thanks for the reply, I dont have redirect=true
  Here is the action:
   
  <action path="/SubmitAction" 
  type="com.test.actions.ListNPAAction" name="InputForm">
  <forward name="Input" path="/jsp/InputForm.jsp"/>
  <forward name="failure" path="/jsp/failure.jsp"/>
  </action>
   
  Thanks again, 

Christopher Schultz <ch...@christopherschultz.net> wrote:
  -----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Maya,

Maya menon wrote:
> In submitAction, I call setter method of formbean and sets the 3rd
> parameter and do mapping.findforward

Does the forward you are using have redirect="true"? If so, the form
bean might be lost of the form bean is not in session scope.

Can you post the relevant parts of your struts-config.xml? That would be
helpful.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGwhTe9CaO5/Lv0PARAppgAKCdANJE6OJE5V9lBiNOeTk3dJqTRQCgmGQu
WnseD+9z1hsQFLUFaDNeX68=
=Rxup
-----END PGP SIGNATURE-----

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



       
---------------------------------
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more. 

Re: Struts 1.2 using formbeans

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Maya,

Maya menon wrote:
> In submitAction, I call setter method of formbean and sets the 3rd
> parameter and do mapping.findforward

Does the forward you are using have redirect="true"? If so, the form
bean might be lost of the form bean is not in session scope.

Can you post the relevant parts of your struts-config.xml? That would be
helpful.

- -chris

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGwhTe9CaO5/Lv0PARAppgAKCdANJE6OJE5V9lBiNOeTk3dJqTRQCgmGQu
WnseD+9z1hsQFLUFaDNeX68=
=Rxup
-----END PGP SIGNATURE-----

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