Setting the form's attribute before forwarding usually works. Your action will have to be declared with a scope appropriate for the config's forward type. (Example: forward type="redirect" and action scope="request" don't play well together.) What scope is the action declared as, and what type of forward is being used? Also, let us see the struts-config elements being used. Thanks! -dave
-----Original Message----- From: Oscar Alvarez [mailto:listasdesarro...@gmail.com] Sent: Wednesday, December 17, 2008 2:50 PM To: Struts Users Mailing List Subject: Re: [S1] How to set a form property from Action classes. 2008/12/17 Oscar Alvarez <listasdesarro...@gmail.com> > Hi All. > > I need to put a value in an ActionForm object, because of the edition use > case of an mantainer (CRUD). > Im using hibernate to save an object and hibernate assigns the id when > save, and i need to put that value back in the ActionForm to "remember it" > when save again. > > I am doing this, but no results yet =( : > ACTION CODE > > if( errors.isEmpty()){ > evaluacionTecnicaManager.save(et); > String mensaje = (isNew ? "Se ha creado " : "Se ha modificado > ") + " la evaluación técnica correctamente"; > request.setAttribute("id_evaluacion", et.getId()); Sorry instead of set request attribute, i need to do this. form.setId(et.getId()); > > errors.add("",new ActionError("mensaje_ejecucion", mensaje)); > } > > saveErrors(request, errors); > > return new ActionForward(actionMapping.getInput()); > > JSP CODE: > > <html:text property="id"/> > > > any help will be apreciated. > Oscar > Notice: This e-mail message, together with any attachments, contains information of Merck & Co., Inc. (One Merck Drive, Whitehouse Station, New Jersey, USA 08889), and/or its affiliates (which may be known outside the United States as Merck Frosst, Merck Sharp & Dohme or MSD and in Japan, as Banyu - direct contact information for affiliates is available at http://www.merck.com/contact/contacts.html) that may be confidential, proprietary copyrighted and/or legally privileged. It is intended solely for the use of the individual or entity named on this message. If you are not the intended recipient, and have received this message in error, please notify us immediately by reply e-mail and then delete it from your system. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org