But ... is BeansUtils method works well with beans based on map? I mean with beans that communication
is with value("property")?
thanks.
Nicolas De Loof <nicolas.deloof@cgey.com> wrote:You should not use your business data
as formBeans for some reasons :
- business data will not have only String or boolean properties
- business data does not have to extend ActionForm
- validate() or reset() have no sense on business tier.
You shoul use a form-bean that will copy datas from business, allow user to edit, and copy
back when save is needed.
Look at BeanUtils.copyProperties() to copy datas from and to business Beans. You can also
create a Factory to make the
copy :
myFactory.getFormBean(businessBean);
myFactory.getBusinessBean(form);
Nico.
>
> Hi everybody!
>
> I'm new in struts and i want to know if someone can help me what is the best form to
update a form from a enterprise
javabean...
>
> this is the code suppossing that the actionForm's name is proyectosForm ...
>
> public ActionForward edicion(ActionMapping mapping, ActionForm form, HttpServletRequest
request, HttpServletResponse
response) throws IOException,ServletException {
>
> String user = request.getSession(true).getAttribute("user"); //To recover the user attributte
>
> ProyectosBean p = getProyectos("user"); //To get the EJB whit the value to edit
>
> request.getSession(true).setAttribute("proyectosForm",p); //to put it the session scope
>
> return mapping.findForward(target);
>
> }
>
> Is this sufficient or i need more?,
>
> Thanks.
>
>
>
>
>
>
> ---------------------------------
> Yahoo! Messenger
> Nueva versión: Super Webcam, voz, caritas animadas, y más #161;Gratis!
---------------------------------------------------------------------
To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-user-help@jakarta.apache.org
---------------------------------
Yahoo! Messenger
Nueva versión: Super Webcam, voz, caritas animadas, y más #161;Gratis!
|