hi
i'd like to update a record from a table from my data base : for exemple, the object "Client"
I used struts 1.0 and now use struts 1.2.6 that why i'm a little bit lost.
The action i call is /accessToUpdateClient.do?id=9

In the action i do :

public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws HibernateException
   {
User currentUser = (User) request.getSession().getAttribute(ControllerConstant.USER);
       currentUser.getLastName();//nullPointerExeption if user not logged.

       Session session = HibernateUtil.currentSession();
       Transaction tx = session.beginTransaction();
Query query = session.createQuery("select c from com.cvdunet.hibernate.Client as c where c.id = :id ");
       query.setString("id", (String)request.getParameter("id"));
       Client client = (Client) query.iterate().next();

       request.setAttribute("client", client);

       tx.commit();
       HibernateUtil.closeSession();
return mapping.findForward("success");
   }


what is the taglib i have to use in my jsp in this case ?
is that the most efficience way to do it ?

Regards.




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to