You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by ultan o'carroll <ul...@totalise.co.uk> on 2000/08/02 17:08:22 UTC
Newbie - session/request object at class level ?
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