struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Troy Hart" <>
Subject Re: Form Bean
Date Wed, 31 Oct 2001 21:55:33 GMT
Ted, your response caught my attention. I haven't noticed problems, but
I also haven't got down to serious debugging so maybe I just haven't
noticed it yet... Anyway, are you supposed to call setServlet() whey you
instantiate a Form yourself and put it on the session (say from within
some Action's perform method)? What about when you set it as a request
attribute? ...I guess the latter case probably wouldn't be a problem???
Are there any other gotcha to watch out for if you are using this



Ted Husted writes: 

> When you create the ActionForm, are you calling setServlet()? 
> Cameron Ingram wrote:
>> Hi all! 
>>  Ok here is the problem.... I have a form bean that I create in an action class,
I then set the variables in it and then add it to the session.
>> This is before the corresponding jsp has been loaded  The jsp is loaded and it appears
that the action servlet is then recreating the form bean and re-adding it to the session,
thus all of the fields I set are set back to there original values. I overrode the reset method
so I know that it's not calling that to clear the variables.  As I understand it the action
servlet should check to see if it's in the session before it recreates it. The name I am using
to define it in the session is the same name that the struts-config file uses to define the
name. Any ideas??? 
>> <form-bean name="editdeleteuserndsForm" ¯->This is the name that I am using
when the form bean is added to the session.
>>               type="net.pscu.ndswebutils.EditDeleteUserNdsForm"/> 
>> --
>> To unsubscribe, e-mail:   <>
>> For additional commands, e-mail: <>
> --
> To unsubscribe, e-mail:   <>
> For additional commands, e-mail: <> 

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message