You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Drasko Kokic <dr...@yahoo.com> on 2000/10/01 01:03:26 UTC

session management under XSP

Hi there,

would anybody have any docs/code samples about session
control?!

also, i am stuck trying to pass one of my variables
into the ESQL block ... is that posible?!  would that
cause Cocoon to get into loop and never finish
processing?!

Thanks for help
Drasko



================== C O D E =====================

<?cocoon-process type="xsp"?>
<?xml-logicsheet
href="resource://org/apache/cocoon/processor/xsp/library/sql/esql.xsl"?>

<xsp:page language="java" create-session="true"
         
xmlns:xsp="http://www.apache.org/1999/XSP/Core"
          xmlns:esql="http://apache.org/cocoon/SQL/v2"
         
xmlns:util="http://www.apache.org/1999/XSP/Util"
         
xmlns:xinclude="http://www.w3.org/1999/XML/xinclude"
         
xmlns:request="http://www.apache.org/1999/XSP/Request">

  <xsp:logic>
    String customeR = null;
  </xsp:logic>

  <PORTFOLIO>

   
<DEBUG>session=<xsp:expr>session.getId()</xsp:expr></DEBUG>
    <xsp:logic>
      customeR = (String) session.getValue ("C");
      if (session.isNew())  { }
      if (customeR == null) 
        {
          session.putValue ("R", "portfolio.xml");
          response.sendRedirect("login.xml");
        }
    </xsp:logic>


    <esql:execute-query>
     
<esql:use-connection>default</esql:use-connection>
      <esql:query>select CASH_VALUE from CUSTOMERS
where
CUSTOMER_ID='<xsp:expr>customeR</xsp:expr>'</esql:query>
      <esql:results>
        <TOTAL><esql:get-float
column="CASH_VALUE"/></TOTAL>
      </esql:results>
    </esql:execute-query>

  </PORTFOLIO>
</xsp:page>

__________________________________________________
Do You Yahoo!?
Yahoo! Photos - 35mm Quality Prints, Now Get 15 Free!
http://photos.yahoo.com/