cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From William Bagby <>
Subject Using HttpSession in XSP
Date Mon, 19 Mar 2001 17:40:22 GMT
I am storing a Config object in the HttpSession.  I would like to be able to
get the Config object from the session in my XSP page.  I have written an
XSP tag library that attempts to do this, but the problem is, I would be
making use of my tags more than once, so I only want to get the Config
object once, then the tags would use Config's methods to get the data from
it.  I cannot seem to firgure out how to do this.

Here's an example of what it is now:

XSP page:

	<welcome>Hello <config:get name="FirstName"/>, glad to see you
		<header>Your Information</header>
			<last-name><config:get name="LastName"/></last-name>
			<address><config:get name="Address"/></address>


config Tag library:

<xsl:template match="config:get">
		((Config)session.getAttribute( "config" )).get(
"<xsl:value-of select="@name"/>" )	


It actually works, but it's ugly and SLOOOOOW.  Like I said, I'd like to
read the Config only once, something like:

Config config = session.getAttribute( "config" );

then have:

<xsl:template match="config:get">
		config.get( "<xsl:value-of select="@name"/>" )	

but I can't seem to figure out how to do this from within the
PopulateDocument method, which seems to be the only place I have access to

I do of course realize this may not be the best way to do what I want to do,
in fact, it's probably not.  But I want to be *sure* that it's not before I
move on to some other way.  I'd also like to get a better sense of how XSP


William Bagby.

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