You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Frederic Alluin <fr...@webmedia.es> on 2000/10/09 20:16:15 UTC
session taglib: create-session
Hi,
I try to use the session taglib without example ;-( and with the
session.xsl code and the mailinglist archive, the next code have to
run.....but no....
<xsp:page
language="java"
xmlns:xsp="http://www.apache.org/1999/XSP/Core"
xmlns:session="http://www.apache.org/1999/XSP/Session"
create-session="true"
>
<page>
<paragraph>
session id is : <session:get-id><br/>
</paragraph>
</page>
</xsp:page>
error:
java.lang.NullPointerException
at
_D_._WebApps._columbia._htdocs._webmedia.populateDocument(_webmedia.java:313)
at
org.apache.cocoon.processor.xsp.XSPPage.getDocument(XSPPage.java:96)
at
org.apache.cocoon.processor.xsp.XSPProcessor.process(XSPProcessor.java:494)
at
org.apache.cocoon.Engine.handle(Engine.java:359)
at
org.apache.cocoon.Cocoon.service(Cocoon.java:167)
at
javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
at
org.apache.jserv.JServConnection.processRequest(JServConnection.java:317)
at
org.apache.jserv.JServConnection.run(JServConnection.java:188)
at java.lang.Thread.run(Thread.java:484)
So has anybody already used the session-create attribute of <xsp:page>
sucessfully ?
And the session taglib in general ?
Regards
Fred
Re: session taglib: create-session
Posted by OD <od...@feersumendjinns.com>.
Hi,
Might not be what you want to hear. I've not managed to get my head round
the session taglib, I've not put much effort in because if you are familiar
with Java's HttpSession object its easy enough to use in an XSP page.
<?xml version="1.0"?>
<?cocoon-process type="xsp"?>
<xsp:page language="java" xmlns:xsp="http://www.apache.org/1999/XSP/Core">
<page>
<xsp:logic>
session = request.getSession(true);
</xsp:logic>
<paragraph>
session id is : <xsp:expr>session.getId()</xsp:expr>
</paragraph>
<paragraph>
session creation time was : <xsp:expr>String.valueOf(new
Date(session.getCreationTime()))</xsp:expr>
</paragraph>
</page>
</xsp:page>
Hope this helps some.
Corey O'Donovan
----- Original Message -----
From: Frederic Alluin <fr...@webmedia.es>
To: Cocoon users <co...@xml.apache.org>
Sent: Monday, October 09, 2000 7:16 PM
Subject: session taglib: create-session
> Hi,
> I try to use the session taglib without example ;-( and with the
> session.xsl code and the mailinglist archive, the next code have to
> run.....but no....
>
> <xsp:page
> language="java"
> xmlns:xsp="http://www.apache.org/1999/XSP/Core"
> xmlns:session="http://www.apache.org/1999/XSP/Session"
> create-session="true"
> >
> <page>
> <paragraph>
> session id is : <session:get-id><br/>
> </paragraph>
>
> </page>
> </xsp:page>
>
> error:
> java.lang.NullPointerException
> at
>
_D_._WebApps._columbia._htdocs._webmedia.populateDocument(_webmedia.java:313
)
>
> at
> org.apache.cocoon.processor.xsp.XSPPage.getDocument(XSPPage.java:96)
> at
>
org.apache.cocoon.processor.xsp.XSPProcessor.process(XSPProcessor.java:494)
>
> at
> org.apache.cocoon.Engine.handle(Engine.java:359)
> at
> org.apache.cocoon.Cocoon.service(Cocoon.java:167)
> at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
> at
> org.apache.jserv.JServConnection.processRequest(JServConnection.java:317)
>
> at
> org.apache.jserv.JServConnection.run(JServConnection.java:188)
> at java.lang.Thread.run(Thread.java:484)
>
> So has anybody already used the session-create attribute of <xsp:page>
> sucessfully ?
> And the session taglib in general ?
>
> Regards
> Fred
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org