On 29.Jun.2003 -- 09:50 PM, C Bram Dit Saint Amand wrote:
> This is an extract from "request_attributes.xsl", a logicsheet which is
> called by "some_page.xsp"
> 
> <xsl:template match="request-attributes:get/webaction">
>     <xsl:variable name="webaction-value"><xsp-request:get-parameter
> name="webaction"/></xsl:variable>
>     <xsl:if test="contains($webaction-value, 'add_to_favourites_session')
> and contains('add_to_favourites_session', $webaction-value)">

$webaction-value most likely contains some XSP or Java code at the
time the logicsheet is applied -- which is when the XSP is translated
to Java servlet sourcecode *not* which every request!

So you may not use XSL to check for run time values in a
logicsheet. You need to use Java instead.

>         <esql:connection>
>           <esql:pool>perso-mysql</esql:pool>
>           <esql:execute-query>
>             <esql:query>INSERT INTO FavouritesBasketSession(SessionID,
> URL) VALUES('<xsp-session:get-id/>', '<xsp-request:get-attribute
> name="relative-url"/>');</esql:query>
>           </esql:execute-query>
>         </esql:connection>
>     </xsl:if> </xsl:template>
> 
> 
> When I access "some_page.xsp?webaction=add_to_favourites_session", the
> template is executed: the <xsl:variable> is created, but what is inside
> the <xsl:if> *isn't* executed, which suggests that there is a problem with
> the <xsl:variable>. For information, displaying the variable's content
> with <xsl:copy-of> works (it correctly displays
> 'add_to_favourites_session'), but with <xsl:value-of> it doesn't display
> anything.

Indeed, since it effectively copies the XSP / Java code used to read
the request attribute. It does not, however, copy the _value_ of that
attribute. 

        Chris.
-- 
C h r i s t i a n       H a u l
[EMAIL PROTECTED]
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to