cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Lamb <p...@oil-law.com>
Subject RE: session obj
Date Wed, 21 Jun 2000 15:04:08 GMT
You can add a create-session="true" to you xsp:page, something like:

<xsp:page 
	language="java" 
	xmlns:xsp="http://www.apache.org/1999/XSP/Core"
	create-session="true"
>

XSP by default does a request.getSession(false). This isn't in the
documentation--if I can find the time I'll send something in.

Paul Lamb
> 
> 
> [snip]
> > No, it was meant to be:
> > <xsp:page language="java"
> > xmlns:xsp="http://www.apache.org/1999/XSP/Core">
> >   <root>
> >     <xsp:logic>
> >      session = request.getSession(true);
> >      ...
> >     </xsp:logic>
> >
> >   <root>
> > </xsp:page>
> > Everything before the <root> tag is class level code (where 
> you define
> > local methods or global variables). Everything inside the 
> <root> tags is
> > the actual method which generate the page and has access to 
> the request
> > object. BTW <root> can be called whatever you like it. It 
> is known as
> > the root tag because its the top most element byside the 
> xsp namespace
> ....this's what I made out of it.
> But that gives me an "DOM006 Hierarchy request error"!
> Here we go...
> 
> <xsl:template match="page">
> ..
> [snip]
> ...
> <xsp:page language="java" 
> xmlns:xsp="http://www.apache.org/1999/XSP/Core">
>     <xsp:logic>
>        HttpSession mysession;
>        static private int counter = 0;
> 
>        private synchronized int getCount(){
>          return counter++;
>        }
> 
>        private String getDescription(){
> 	 String s;
>          s = "session id = " + mysession.getId() + "&lt;br&gt;" +
>              "session is new = " + mysession.isNew() + "&lt;br&gt;" +
>              "session creation time = " + new
> Date(mysession.getCreationTime()) + "&lt;br&gt;" +
>              "session last access = " + new
> Date(mysession.getLastAccessedTime()) + "&lt;br&gt;" ;
>          return(s);
>        }
>     </xsp:logic>
>     <root>
>       <xsp:logic>
>          mysession = request.getSession(true);
>       </xsp:logic>
>     </root>
>     <xsl:copy>
>       <xsl:apply-templates/>
>     </xsl:copy>
>   </xsp:page>
> </xsl:template>
> 
> What did I get wrong now ?!
> --
> Torsten
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: cocoon-users-help@xml.apache.org
> 

Mime
View raw message