cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fabio....@swissonline.ch
Subject session problem
Date Thu, 08 Jul 2004 16:53:27 GMT
Hi,

I'm working aorund the same problem. I am creating in a xsl page a session context and i add
some atributes to this context with a sql statement. But then i want to access these attibutes
in a xsp file but the <xsp-session:get-attribute name="ID_user"  /> tag returns nothing.
But the <name><xsp-session:get-attribute-names as="xml" /> Tag returns ID_user.
I have no idea why. Does sombody have hint or a solution? 
The files:

CreateSession.xsl :
***********************
<?xml version="1.0"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:session="http://apache.org/cocoon/session/1.0">

<!-- Make the request parameter available -->
<xsl:param name="id"/>
<xsl:param name="password"/>

<xsl:template match="login">
<resource xmlns:session="http://apache.org/cocoon/session/1.0">
  <session:createcontext name="user"/>
  <!-- build context data -->
  <session:setxml context="user" path="/">
    <context>
	
  <execute-query xmlns="http://apache.org/cocoon/SQL/2.0"> 
   <query>
        SELECT ID_user from benutzer where id_user = '<xsl:value-of select="$id"/>'
and password = '<xsl:value-of select="$password"/>'
   </query>
  </execute-query>
    </context>
  </session:setxml>
</resource>
</xsl:template>

</xsl:stylesheet>
***********************
readSession.xsp
***********************
<?xml version="1.0" encoding="iso-8859-1"?>

<xsp:page
   language="java"
   xmlns:xsp="http://apache.org/xsp"
   xmlns:xsp-session="http://apache.org/xsp/session/2.0"
   xmlns:xsp-request="http://apache.org/xsp/request/2.0"
>

<user>
    <ID_user><xsp-session:get-attribute name="ID_user"  /></ID_user>
    <ID_user2><xsp-session:get-attribute name="org.apache.cocoon.webapps.session.context.SessionContext"
as="xml" /></ID_user2>
        <ID2><xsp-session:get-cookies  /></ID2>
        <name><xsp-session:get-attribute-names as="xml" /></name>
        <ID><xsp-request:get-requested-session-id as="xml"/></ID>
   
 </user>
</xsp:page>
******************************
output of readSession:
******************************
<user>
<ID_user/>
-
	<ID_user2>
<xsp-session:attribute>{}</xsp-session:attribute>
</ID_user2>
-
	<ID2>
<xsp-session:get-cookies/>
</ID2>
-
	<name>
-
	<xsp-session:attribute-names>
<xsp-session:attribute-name>ID_user</xsp-session:attribute-name>
-
	<xsp-session:attribute-name>
org.apache.cocoon.webapps.session.context.SessionContext
</xsp-session:attribute-name>
</xsp-session:attribute-names>
</name>
-
	<ID>
<xsp-request:requested-session-id>sfv37dwlgxdp</xsp-request:requested-session-id>
</ID>
</user>
*********************


A hint would be nice.

Thanks for reading this
Fabio

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


Mime
View raw message