> -----Original Message----- > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, January 08, 2003 3:51 PM > To: [EMAIL PROTECTED] > Subject: session scope ActionForm > > > I am a bit confused about session scope of ActionForm. > > For example, in my ActionForm testForm > > private String field1 ; > private String filed2 ; > > I instantiate testForm in a PageOneLoadAction > > TestForm testForm = new TestForm() ; > Request.getSession().setAttribute("testForm", testForm) ; > > On page one, I only need to enter field 1 > > <html:form ....> > ... > <html:text property="field1"/> > </html:form> > > Once I subimit, I assume that value of field 1 is saved into testForm. >
Only if the action-mapping for the above form uses the form-bean named "testForm". > Now I load page 2 which only requires user entering field 2. > > <html:form...> > ... > <html:text property="field2"/> > </html:form> > > If I submit, value of field 2 is saved into testForm. Will > value of field 1 be kept in testForm? > Yes, unless the reset() method of TestForm is clears it. Another obscure reason when it won't show up is if the action for page-2 refers to the form-bean with a different name. > > Regards, > > > > PQ > Sri -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>