You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by "KUMAR,PANKAJ (HP-Cupertino,ex1)" <pa...@hp.com> on 2001/07/02 18:51:40 UTC

An observation on using session logicsheet ...

Hi,

I observed the following while using C2beta1 session logicsheet ( WindowsNT,
Tomcat 3.2.1 ):

Use of statement " <session:set-attribute
name="app-name"><xsp:expr>"Something"</xsp:expr></session:set-attribute>" in
an XSP page causes a NullPointerExcpetion at execution time. However,
preceding this statement with statement "<session:get-id as="xml"/>" gets
rid of the exception ( this is my current workaround).

While browsing the generated code and Cocoon source code for
XSPRequestHelper.java and Request.java, I realized that "<session:get-id
as="xml"/>" causes Request.getSession() to be called that creates the
session, whereas " <session:set-attribute
name="app-name"><xsp:expr>"Something"</xsp:expr></session:set-attribute>"
causes Request.getSession(false) to be called that doesn't create the
session.

As I don't see any specific tag in session logicsheet for creating a
session, this may be a bug.

"Session Logicsheet" documentation talks of attribute "create-session" in
<xsp:page> tage but it didn't seem to work. I don't see this attribute being
used in XSP logicsheet "xsp.xsl" anyway !!

A plausible solution would be to introduce a tag <session:create-session/>
or a pair <session:create-session/> and <session:destroy-session/>

Pankaj.

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org


Re: An observation on using session logicsheet ...

Posted by Christian Haul <ha...@dvs1.informatik.tu-darmstadt.de>.
On 02.Jul.2001 -- 09:51 AM, KUMAR,PANKAJ (HP-Cupertino,ex1) wrote:
> As I don't see any specific tag in session logicsheet for creating a
> session, this may be a bug.

You could <session:get-id/> to create a new session if no session
exists.

	Chris.

-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org