cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Marcelo F. Ochoa" <moc...@ieee.org>
Subject RE: Cookie TagLib?
Date Tue, 25 Jul 2000 22:26:59 GMT

> Gang -
> 
> Does anyone have any pointers or docs on using the XSP Cookie taglib? I've
> read the source, but that's not helping too much for waht I want to do. 
> 
> Here's what I'd *LIKE* to do :
> 
> <cookie:create name="User"><request:get-remote-user/></cookie:create>

i this you need to do this:

<cookie:create name="User">
 <value><request:get-remote-user/></value>
</cookie:create>

from the cookie logicsheet:

  <xsl:template match="cookie:create">
    <xsl:variable name="name">
      <xsl:call-template name="value-for-name"/>
    </xsl:variable>

    <xsl:variable name="value">
      <xsl:choose>
        <xsl:when test="@value">"<xsl:value-of
select="@value"/>"</xsl:when>
        <xsl:when test="value">
          <xsl:call-template name="get-nested-content">
            <xsl:with-param name="content" select="value"/>
          </xsl:call-template>
        </xsl:when>
      </xsl:choose>
    </xsl:variable>

    <xsp:expr>
      new Cookie(
        String.valueOf(<xsl:copy-of select="$name"/>),
        String.valueOf(<xsl:copy-of select="$value"/>)
      )
    </xsp:expr>
  </xsl:template>

- donald

[Marcelo F. Ochoa]  I think that this taglib need to add this Cookie to the response object.
Ej:
   response.add(CookieObj);

Response object isnĀ“t exposed into XSP pages (XSP Pages are compiled as producer under version
1.x), you could add cookie definitions by HeaderProcessor class from DB Prism Servlet Engine.
Regards, Marcelo.

Mime
View raw message