I'm creating session object called "employee" during login time by a JSP page (using a bean).  I would like to be able read the "employee" session information to validate a user in XSP (within my XML file) like this:
 
<?xml version="1.0"?>
<?cocoon-process type="xsp"?>
<?cocoon-process type="xslt"?>
<xsp:page
    xmlns:xsp="http://www.apache.org/1999/XSP/Core"
    xmlns:session="http://www.apache.org/1999/XSP/Session"
    create-session="true"
>
<xsp:structure>
    <xsp:include>name.modulename.EmployeeData</xsp:include>
</xsp:structure>
 
<page>
    <xsp:logic>
        EmployeeData employeeData = null;
        employeeData = (EmployeeData)<session:get-attribute name="employee"/>;
        if( employeeData != null ) System.out.println( "Data ID: " + employeeData.getEmployee_id() );
        else System.out.println( "Data ID: none" );
    </xsp:logic>
</page>
 
This line:
employeeData = (EmployeeData)<session:get-attribute name="employee"/>;
never finds the session variable called "employee" (remember it was created by a JSP page calling a bean) so the only value I receive is "null".
How can I read this session value in XSP/XML?
 
Thanks!
Mark

Reply via email to