struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gaffer <gaf...@cox.net>
Subject Re: How to get form values when actionForm is in session
Date Wed, 26 Mar 2003 06:06:49 GMT
Sorted it out. Need to create a property with the submit, create getters
and setters for that property, and fetch the property instead of the
submit. 

Thanks


On Tue, 2003-03-25 at 21:41, gaffer wrote:
> I don't need a new session so removing "true" is a good idea. Thanks 
> 
> I did another test, but fetched another string attribute instead of the
> submit button value. Got the correct value from the string so I am
> seeing my session data. Though why would I not get something back from
> submit attribute? I have getters and setters in my actionForm
> 
> getSubmit() { return submit }
> 
> setSubmit(String submit) {this.submit = submit}
> 
> On Tue, 2003-03-25 at 20:35, Scott Barr wrote:
> > Hi 
> > 
> > Are you sure you have an existing session? Using
> > request.getSession(true) will create a new session if one doesn't
> > already exist.
> > 
> > Try this instead. Placing the form that is passed in to your Action
> > class' execute method, into the HttpSession.
> > The form bean isn't put into session for you initially, which i think is
> > what you are expecting.
> > 
> > Scott Barr
> > www.exergonic.com.au
> > 
> > 
> > On Wed, 2003-03-26 at 14:48, gaffer wrote:
> > 
> > > I am trying to get the values from my actionForm that is in session
> > > scope but get nothing when I use:
> > > 
> > > HttpSession session = request.getSession(true);
> > > OperatornetworkForm form = (OperatornetworkForm)
> > > session.getAttribute("operatornetworkForm"); 
> > > //operatornetworkForm is the name of the form bean set in
> > > //actionmappings.
> > > 
> > > System.out.println("The submit value is " + form.getSubmit());
> > > 
> > > Any suggestions?
> > > 
> > > Thanks
> > > Al
-- 
gaffer <gaffer@cox.net>


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


Mime
View raw message