> Could you put the code in your mail where you retrieve the session object
> itself?

I made a logicsheet for this. It declare the DBUser object.

<!--
  ******************************************************************** -->
<!--    Create and set a DBUser to the correct user if connected-->
<xsl:template match="tlsystem:GetUser">
        <xsp:logic>
                // Define a initial default user that is anonymous
                 XUser DBUser = new XUser() ;
                <!--If the cast is not correct, the page have been recompiled -->
                <!-- So we do a logoff and we ask for restart tomcat-->
                if ((session.getAttribute("user") != null) &amp;&amp;
(!(session.getAttribute("user") instanceof XUser)))
                {
                        session.removeAttribute("user") ;
                        <xsp:content>Error: Need  to Restart Tomcat!</xsp:content>
                }
                else
                {       <!-- Testing if the user is logged -->
                        if ((session.getAttribute("user") != null) )
                        {
                                DBUser = (XUser) session.getAttribute("user") ;
                        }
                }
        </xsp:logic>
</xsl:template>


then I use it like
<page>
        <tlsystem:GetUser/>
        Welcome <xsp:expr>DBUser.name</xsp:expr>
        Your employee number is <xsp:expr>DBUser.ID</xsp:expr>
</page>


> Pages aren't synchronized because this introduces a bottleneck,
> and because they don't need to be. Just be carefull with your variable
> declarations.

If the pages aren't synchronized, i'm curious to now how you declare and use
your classes variables in a thread safe manner.

-tony


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail: <[EMAIL PROTECTED]>

Reply via email to