cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andres, Judith" <judith.and...@rauser-ag.com>
Subject AW: Passing xmap parameters to xsp
Date Thu, 06 Jun 2002 07:17:34 GMT
Daniel,

to use the SourcePage parameter in the xsp you have to do this:

<xsp:logic>
  String sourcePage = parameters.getParameter("SourcePage",
"aDefaultValue");
</xsp:logic>

parameters is a default attribute in your xsp to handle parameters from the
sitemap;
If you don't provide a default value you have to catch an exception that's
thrown by the getParameter method

As for the esql logicsheet, I don't know how to handle variables there but
try:
<xsp:expr>sourcePage</xsp:expr>

Judith

> -----Urspr√ľngliche Nachricht-----
> Von:	Vadim Gritsenko [SMTP:vadim.gritsenko@verizon.net]
> Gesendet am:	Donnerstag, 6. Juni 2002 00:28
> An:	cocoon-users@xml.apache.org
> Betreff:	RE: Passing xmap parameters to xsp
> 
> Daniel:
> 
> Please remove line 
>   <map:parameter name="use-request-parameters" value="true"/>
> from the snippet below.
> 
> 
> Naquin:
> 
> use-request-parameters parameter does not mean anything to serverpages
> generator. But it can mean something to your particular page...
> 
> 
> Regards,
> Vadim
> 
> 
> -----Original Message-----
> From: Naquin, Beth [mailto:Beth.Naquin@morpho.com] 
> Sent: Wednesday, June 05, 2002 5:33 PM
> To: 'cocoon-users@xml.apache.org'
> Subject: RE: Passing xmap parameters to xsp
> 
> I am new to cocoon myself, so take this with a grain of salt: 
> The sitemap error may be because you closed the <map:generate /> tag
> before you passed the parameter? 
> Try something like: 
> <map:generate type="serverpages" src="xsp/w3/index2.xsp"> 
>         <map:parameter name="use-request-parameters" value="true"/> 
>        <map:parameter name="SourcePage" value="Index"/> 
> </map:generate> 
> I don't know that the xsp page will automatically recognize $SourcePage
> as a parameter, but this might resolve the sitemap error.
> P.S. 
> This approach works for me when I want to pass a parameter to a
> transformer and then use that parameter in my xsl stylesheet, but I have
> never done so with a generator.
> Good Luck, 
> Beth 
> 
> -----Original Message----- 
> From: daniel robinson [mailto:drob@dnai.com] 
> Sent: Wednesday, June 05, 2002 2:07 PM 
> To: cocoon-users@xml.apache.org 
> Subject: Passing xmap parameters to xsp 
> 
> Ok, I've been struggling with this for hours. 
> I want to set a parameter in my pipeline something like this: 
>  <map:match pattern="index"> 
>     <map:generate type="serverpages" src="xsp/w3/index2.xsp"/> 
>        <map:parameter name="SourcePage" value="Index"/>             
> <-------- 
> Set it here 
>    <map:transform src="stylesheets/w3/index2.xsl"/> 
>      <map:serialize/> 
>   </map:match> 
> and then use it in index2.xsp.  I tried this: 
> ...snip... 
>      <esql:execute-query> 
>        <esql:query> 
>                 select * from "Story" 
>                      where 
>                     "ProjectName" = 'MyProj' 
>                         and 
>                     "PageName" = '"$SourcePage"'           <----- use it
> here 
> ...snip... 
> 
> Please help.  I've been looking all through the doco - examples etc.  
> When I 
> try the above I get an exception when Cocoon attempts to recompile the 
> sitemap. 
> Thanks, 
> Dan 
> 
> --------------------------------------------------------------------- 
> 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> 
> 
> 
> ---------------------------------------------------------------------
> 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>

---------------------------------------------------------------------
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