struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Yee <rye...@yahoo.com>
Subject Re: How to set an ActionForm to null
Date Fri, 14 May 2004 21:05:33 GMT
pls,
If the form exists in session scope, then you need to
remove it from session using the
request.getSession.removeAttribute(<formName>) method
call. Otherwise, when the JSP page is executed, struts
will use the form from the session.

Regards,

Richard

--- pls <abenwoha@hotmail.com> wrote:
> that won't change the form as it exists in session
> scope, only temporarily
> in the action.. thanks anyways
> 
> "Kiran Kumar" <mkirank@yahoo.com> wrote in message
>
news:20040514051357.51808.qmail@web50406.mail.yahoo.com...
> > just a guess in ur execute method try this
> >
> > form = null;
> >
> >
> >
> > --- pls <abenwoha@hotmail.com> wrote:
> > > thanks for the suggestion Amol, but that returns
> an
> > > IllegalStateException..
> > > thanks for trying anyways.
> > >
> > >
> > > "Amol Yadwadkar" <AmolY@quinnox.com> wrote in
> > > message
> > >
> >
>
news:DC3F2CFCB6D7684A824DACC7DD1C1322011EE9F9@IS3CM_MAIL...
> > > > Hi,
> > > > I havn't tried this but just try this in the
> > > execute method :--
> > > > public ActionForward execute(ActionMapping
> > > mapping, ActionForm form,
> > > > HttpServletRequest req, HttpServletResponse
> res) {
> > > > ........
> > > > ...
> > > > ...
> > > > mapping.setAttribute(null);
> > > >
> > > > }
> > > >
> > > > Hope this may help you!!!
> > > > --Amol
> > > >
> > > > -----Original Message-----
> > > > From: pls [mailto:abenwoha@hotmail.com]
> > > > Sent: Friday, May 14, 2004 10:03 AM
> > > > To: user@struts.apache.org
> > > > Subject: How to set an ActionForm to null
> > > >
> > > >
> > > > hi there,
> > > >
> > > > i am trying to set an actionform to null after
> > > inserting it's properties
> > > > into a DB.
> > > > then, control is forwarded to a different
> action
> > > and the info is read from
> > > > the DB back into the actionform for display by
> a
> > > JSP.
> > > >
> > > > the only part that is giving me trouble is
> with
> > > explicitly setting my
> > > > actionform "MBForm" to null.  After several
> form
> > > submissions and a DB
> > > > update, the first Action attempts to clear the
> > > values in MBForm:
> > > >
> > > >      
> request.getSession().setAttribute("MBForm",
> > > null);
> > > >
> > > > after this, control is forwarded to the second
> > > Action which handles the
> > > > display.  it checks to see if MBForm is null
> and,
> > > if it is, it fills
> > > MBForm
> > > > from a DB.   in between these two actions, the
> > > controller servlet is
> > > > automatically refilling the MBForm with the
> values
> > > that I just nullified..
> > > > the only bean property that stays empty is
> myHash
> > > which represents several
> > > > groups of multiboxes.  i believe this is a
> result
> > > of the MBForm reset()
> > > > method which contains the following:
> > > >
> > > >      myHash.put(multiBoxCategories, new
> > > Integer[0]);  //resets several
> > > > groups of multiboxes
> > > >
> > > > setting other properties to null in the
> reset()
> > > method is not the solution
> > > > as it wipes the value out after every (but
> somehow
> > > it doesn't do the same
> > > > thing to the multiboxes?!?)
> > > >
> > > > let me know if this enough background for you
> to
> > > help me diagnose the
> > > > problem..  any discussion of reset() or is
> > > welcome..  thanks
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> >
>
---------------------------------------------------------------------
> > > > To unsubscribe, e-mail:
> > > user-unsubscribe@struts.apache.org
> > > > For additional commands, e-mail:
> > > user-help@struts.apache.org
> > >
> > >
> > >
> > >
> > >
> >
>
---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > > user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail:
> > > user-help@struts.apache.org
> > >
> >
> >
> >
> >
> >
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Movies - Buy advance tickets for 'Shrek 2'
> >
>
http://movies.yahoo.com/showtimes/movie?mid=1808405861
> 
> 
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@struts.apache.org
> For additional commands, e-mail:
> user-help@struts.apache.org
> 



	
		
__________________________________
Do you Yahoo!?
SBC Yahoo! - Internet access at a great low price.
http://promo.yahoo.com/sbc/

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


Mime
View raw message