Hi Tom Thanks for that
Where is a good place to remove beans from the session scope? Do I have to forward to an action that does this for me? Also, I thought there was a difference between 'page' and 'request' scope. Is there no such thing as page scope in struts? Marcos > -----Original Message----- > From: Tom Klaasen (TeleRelay) [mailto:[EMAIL PROTECTED]] > Sent: 19 November 2001 09:16 > To: Struts Users Mailing List > Subject: RE: Setting up a form in an action > > > > > > -----Original Message----- > > From: Scriven, Marcos [mailto:[EMAIL PROTECTED]] > > Sent: zondag 18 november 2001 18:32 > > To: 'Struts Users Mailing List' > > Subject: Setting up a form in an action > > > > > > I am trying to do this sequence of events: > > > > 1) setupProductForm.do?isin=abcd > > > > 2) This creates a productForm instance, and initialises the > > product, based > > on the given ISIN > > > > 3) persistProduct - This should save the product > > > > What happens at the moment is my form is my setupProductForm action > > correctly loads the product, and sets it on the form: > > > > productForm.setTradeProduct(tradeProduct); > > > > On success, I forward to 'success', which maps to productForm.jsp > > > > > > The action in productForm is persistProduct > > > > When I submit this form, in the validate() method I output > > the tradeProduct > > to the console - this confirms that a new form has been > > created, and the > > attributes persisted from the values in the form. > > > > This wouldn't be a problem, but I have a productID, which is > > not in the > > form, and I don't think it should be. For that reason, it's > > just the default > > '-1' I set it to in the static intialiser. > > > > Do I have to have unseen attributes as hidden fields in the > > JSP, and why? > > Since you're using the 'request' scope, the unseen attributes > have to be > hidden fields, yes. After the first request is sent, Struts 'forgets' > the form, until it receives it again. > > If you really hate the hidden fields, use the 'application' > scope. Don't > forget to remove the form bean though. > > hth, > tomK > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>