Tnxalot

On 01 Apr 2005, at 17:55, [EMAIL PROTECTED] wrote:


hi Yves

a simple code fragment in XSP

...
<xsp:logic>
String parent_role = <xsp-request:get-parameter name="parent_role"/>;
String parent_id = <xsp-request:get-parameter name="parent_id"/>;


                 if (parent_id==null){
                    parent_id =
<xsp:expr>
 <xsp-cookie:getValue>                                                          
                          
  <xsp-cookie:name>                                                             
                                  
 <xsp:expr>parent_role</xsp:expr>                                               
                    
  </xsp-cookie:name>                                              
 </xsp-cookie:getValue>                                                         
  
</xsp:expr>;
                                                                                
<role><xsp:expr>parent_id</xsp:expr></role>

                 }else{
<xsp-cookie:create-cookies>
   <xsp-cookie:cookie>
     <xsp-cookie:name>
       <xsp:expr>parent_role</xsp:expr>
     </xsp-cookie:name>
     <xsp-cookie:value>
       <xsp:expr>parent_id</xsp:expr>
     </xsp-cookie:value>
   </xsp-cookie:cookie>
</xsp-cookie:create-cookies>      
                }
                </xsp:logic>

...

be carefull to declare namespaces
<xsp:page language="java" xmlns:xsp="http://apache.org/xsp";
xmlns:esql="http://apache.org/cocoon/SQL/v2";
xmlns:xsp-request="http://apache.org/xsp/request/2.0";
xmlns:xsp-cookie="http://apache.org/xsp/cookie/2.0";>

this is an 2 years old implementation in XSP i have found in my disk that
work


i'll suggest you to use flow instead of XSP (but this depends of your
needs)


http://cocoon.apache.org/2.1/userdocs/flow/api.html http://cocoon.apache.org/2.1/userdocs/flow/api.html#Cookie+Object

regards

stavros


On Fri, 1 Apr 2005, Yves Vindevogel wrote:

Hi,

Where can I find a newbie example on how to use cookies in cocoon ?
I need to drop a cookie on the client and read it back ...

Regards,
Yves


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




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




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



Reply via email to