cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antonio Parolini" <>
Subject RE: Cocoon and threads
Date Fri, 01 Jun 2001 20:13:53 GMT
> 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">
		// 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>
		{	<!-- Testing if the user is logged -->
			if ((session.getAttribute("user") != null) )
				DBUser = (XUser) session.getAttribute("user") ;

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

> 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.


Please check that your question has not already been answered in the
FAQ before posting. <>

To unsubscribe, e-mail: <>
For additional commands, e-mail: <>

View raw message