On 05.Feb.2003 -- 11:00 AM, Cyril Vidal wrote:
>
> Thanks for you response.
> hum, I guess actions are still a little bit too complex for me, regarding my
> knowledge of Cocoon...
>
> Isn't it really possible to add merely values to the same session's
> attribute with the ESQL logicsheet? It sounds odd...
Er, no. But you probably didn't mean ESQL anyway.
You need to do it as you did it before: retrieve the value, add a new
element to it and then store it again.
> > > // Cart items are maintained in the session object.
> > > Vector items = (Vector)session.getAttribute("cart.items");
> > > if (items == null) { items = new Vector(10,5);}
> > >
> > > String item = req.getParameter("item");
> > > items.add(item);
> > >
> > > session.setAttribute("cart.items",items);
Would translate to
<xsp:logic>
Object items = <xsp-session:get-attribute name="cart.items"/>;
if (items == null) items = new Vector(10,5);
((Vector) items).add(<xsp-request:get-parameter name="item"/>);
request.getSession().setAttribute(items);
// logicsheet only supports setting Strings objects :-(
// thus do it manually.
</xsp:logic>
Chris.
--
C h r i s t i a n H a u l
[EMAIL PROTECTED]
fingerprint: 99B0 1D9D 7919 644A 4837 7D73 FEF9 6856 335A 9E08
---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>