cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Myers <phan...@stserv.hcf.jhu.edu>
Subject Re: [C2.0.1] session:set-attribute
Date Tue, 12 Mar 2002 10:35:41 GMT
I can't find XSPRequestHelper.setSessionAttribute

I haven't update cvs in more than a week,
but here's what i see in the relavent template:

  <xsl:template match="xsp-session:set-attribute">
    <xsl:variable name="name">
      <xsl:call-template name="value-for-name"/>
    </xsl:variable>
    <xsl:variable name="content">
      <xsl:call-template name="get-nested-content">
        <xsl:with-param name="content" select="."/>
      </xsl:call-template>
    </xsl:variable>
    <xsp:logic>
      request.getSession().setAttribute(
          String.valueOf(<xsl:copy-of select="$name"/>),
          <xsl:copy-of select="$content"/>);
    </xsp:logic>
  </xsl:template>

You certainly should be able to set session attributes.  Try putting
( ) around sReport like <xsp:expr>(sReport)</xsp:expr>

I'm not promising anything, but it works for me.

On Tue, Mar 12, 2002 at 11:14:44AM +0100, Christian Joelly wrote:
> Hello!
> 
> can session attributes only be set through the sitemap? if i look at the
> generated java code, i think it is impossible to set session attributes
> from java variables or from an string object...
> 
> <session:set-attribute name="report"><xsp:expr>sReport</xsp:expr></session:set-attribute>
> 
> XSPRequestHelper.setSessionAttribute(objectModel, String.valueOf("report"), "sReport");
> 
> Chris
> 
> -- 
> KNAPP Logistics Automation  http://www.knapp.com
> Ing. Christian Jölly        Tel/FAX: (++43) 316 / 495 1926 / 495 394
> Günter-Knapp-Straße 5-7     A-8075 Hart bei Graz
> 



---------------------------------------------------------------------
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: <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail: <cocoon-users-help@xml.apache.org>


Mime
View raw message