cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Colin Britton" <co...@freefoto.com>
Subject [C2] Response logicsheet problem
Date Tue, 06 Mar 2001 16:46:00 GMT
The following XSP using the request and response logic sheets did not work
due to an error in the response logicsheet. Here is the example and the diff
of the corrected logicsheet for someone to look at.

<?xml version="1.0" encoding="ISO-8859-1"?>
<xsp:page
          language="java"
          xmlns:xsp="http://apache.org/xsp"
          xmlns:xsp-request="http://apache.org/xsp/request"
          xmlns:xsp-response="http://apache.org/xsp/response"
>
  <content>
  <xsp-response:send-redirect>
 <xsp-response:location><xsp-request:get-parameter
name="U"/></xsp-response:location>
  </xsp-response:send-redirect>

  </content>

</xsp:page>

The logicsheet has the xsl following in it:

 <xsl:template match="xsp-response:send-redirect">
    <xsl:variable name="location">
      <xsl:choose>
        <xsl:when test="@location">"<xsl:value-of
select="@location"/>"</xsl:when>
        <xsl:when test="location">
          <xsl:call-template name="get-nested-content">
            <xsl:with-param name="content" select="xsp-response:location"/>
          </xsl:call-template>
        </xsl:when>
      </xsl:choose>
    </xsl:variable>
    <xsp:logic>
      XSPResponseHelper.sendRedirect(response, <xsl:value-of
select="$location"/>);
    </xsp:logic>
  </xsl:template>

The <xsl:when test="location"> element should have the namespace prefix in
order to match <xsl:with-param name="content"
select="xsp-response:location"/>

This error is also in the set-content-type and set-header elements in the
response logicsheet.

Logicsheet changes:

cvs diff response.xsl (in directory
D:\xml_technology\C2\xml-cocoon\src\org\apache\cocoon\components\language\ma
rkup\xsp\java\)
Index: response.xsl
===================================================================
RCS file:
/home/cvspublic/xml-cocoon/src/org/apache/cocoon/components/language/markup/
xsp/java/Attic/response.xsl,v
retrieving revision 1.1.2.7
diff -r1.1.2.7 response.xsl
29c29
< <xsl:when test="name">
---
> <xsl:when test="xsp-response:name">
40c40
< <xsl:when test="value">
---
> <xsl:when test="xsp-response:value">
58c58
< <xsl:when test="type">
---
> <xsl:when test="xsp-response:type">
75c75
< <xsl:when test="location">
---
> <xsl:when test="xsp-response:location">
*****CVS exited normally with code 1*****

rgds
CB



Mime
View raw message