cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ultan o'carroll <ul...@totalise.co.uk>
Subject Newbie - session/request object at class level ?
Date Wed, 02 Aug 2000 15:08:22 GMT
Dear All,


Im getting errors when I try to use a tag library that Im developing
(trying to develop I should say)
telling me that I have "undefined variable or class names" (sepcifically
request, session, log)
when I try to use these objects in the class level logic element of the
library (see <!-- ** here ** --> comments )-

========================================================================================

<xsl:template match="xsp:page">
    <xsp:page language="java"
xmlns:xsp="http://www.apache.org/1999/XSP/Core">

    <xsl:copy>
        <xsl:apply-templates select="@*"/>
    </xsl:copy>

    <xsp:structure>
        <xsp:include>com.ceremony.persistent.User</xsp:include>
        <xsp:include>com.ceremony.exceptions.*</xsp:include>
    </xsp:structure>

    <xsp:logic>


      static private int counter = 0;
      User myUser = new User();

      private synchronized void getUser() {
       <!-- ** here ** -->
        if(session.getValue("ultan.user") == null) {
            <!-- ** here ** -->
            log("In getUser()");
               <!-- ** here ** -->
            String sClientNum =
request.getParameterValues("ClientNum")[0];

            try {

                myUser.setLoginName( "ultano" );
                myUser.setClientNumber( sClientNum );
                myUser.retrieve();

            } catch (CITDatabaseException de) {
  <!-- ** here ** -->
                log("Database exception getting user details in
ultan.xsl " + de.toString() );
                return;

            } catch (CITServerException se) {

                log("Server exception getting user details in ultan.xsl
: " + se.toString() );
                return;
            }
     <!-- ** here ** -->
            session.putValue("ultan.user", myUser);
        }

      }

    </xsp:logic>

    <xsl:apply-templates/>

   </xsp:page>

  </xsl:template>

========================================================================================


  I understood that these objects were made available in XSP thru
wrappers and that I could call on HttpServlet superclass methods such as
'log(String)' ? Am I
  doing something wrong, got the wrong end of the stick, or do I need
a   holiday ? (If I get this going I should be a millionaire by the end
of   the week)


  Thanks in advance -

  Ultan O'Carroll


Mime
View raw message