You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by vasudevrao gupta <va...@wipro.com> on 2003/12/18 06:30:06 UTC

Help needed in form beans

Hi All,

I have a same form bean for 5 JSP's(JSP1,JSP2,JSP3,JSP4,JSP5)

All the JSP's use the same form bean.I am keeping the form bean in the
session scope.

When ever I use JSP1, JSP3, I want to see the blank screen even if there
are some values in the formbean.
But, in other JSP's, I want to see the screen with prepopulated values.
I tried using reset() for this and I have set all the values in formbean
to null.But reset is getting called 
for all the action.I want reset to be called only for JSP1,JSP3.

Please provide any direction on this

Regards
VasudevRaoGupta


Confidentiality Notice 

The information contained in this electronic message and any attachments to this message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged information. If
you are not the intended recipient, please notify the sender at Wipro or Mailadmin@wipro.com immediately
and destroy all copies of this message and any attachments.

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


RE: Help needed in form beans

Posted by Robert Taylor <rt...@mulework.com>.
You may want to consider creating a separate object to hold these
values in the session and use your form beans for data input.
This way you can decide when to populate your form beans with
the data that you've captured in the session. 

To control when reset() affects my form properties I subclassed
the action form and subclassed ActionMapping to add an isReset()
setReset(boolean reset) methods so I can declaratively define
when reset is to be used by adding the following line in my struts-config
file:

<set-property property="reset" value="false"/>

robert

> -----Original Message-----
> From: vasudevrao gupta [mailto:vasudevrao.gupta@wipro.com]
> Sent: Thursday, December 18, 2003 12:30 AM
> To: 'Struts Users Mailing List'
> Subject: Help needed in form beans
> 
> 
> 
> Hi All,
> 
> I have a same form bean for 5 JSP's(JSP1,JSP2,JSP3,JSP4,JSP5)
> 
> All the JSP's use the same form bean.I am keeping the form bean in the
> session scope.
> 
> When ever I use JSP1, JSP3, I want to see the blank screen even if there
> are some values in the formbean.
> But, in other JSP's, I want to see the screen with prepopulated values.
> I tried using reset() for this and I have set all the values in formbean
> to null.But reset is getting called 
> for all the action.I want reset to be called only for JSP1,JSP3.
> 
> Please provide any direction on this
> 
> Regards
> VasudevRaoGupta
> 
> 
> Confidentiality Notice 
> 
> The information contained in this electronic message and any 
> attachments to this message are intended
> for the exclusive use of the addressee(s) and may contain 
> confidential or privileged information. If
> you are not the intended recipient, please notify the sender at 
> Wipro or Mailadmin@wipro.com immediately
> and destroy all copies of this message and any attachments.
> 
> ---------------------------------------------------------------------
> 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