You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Jan Wielgus <li...@o2.pl> on 2003/11/01 20:48:58 UTC

[XSP] Java variables within tag attributes

Hello,

I want to do something like this: I want to include a page in my
main page depending on a request parameter:

<xsp:logic>
       	String page = <xsp-request:get-parameter name="page"/>;
       	if(page==null || page=="") page =
"cocoon:/pagecontent/kategorien.xsp";
</xsp:logic>    

But then I have a problem. How can I pass the variable 'page' to the
<cinclude>-tag?

<cinclude:include src=" <-- here I don't know how to do it :((

Any help will be appreciated

Regards

Jan

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [XSP] Java variables within tag attributes

Posted by Olivier Billard <ob...@rennes.jouve.fr>.
Hi Jan,

XSP can add dynamic attributes, just like XSL with its <xsl:attribute>, but here it's 
<xsp:attribute> :).

Try this :

<cinclude:include>
<xsp:attribute name="src"><xsp:expr>page</xsp:expr></xsp:attribute>
</cinclude:include>

--
Olivier



On 01/11/2003 20:48, Jan Wielgus wrote:

> Hello,
> 
> I want to do something like this: I want to include a page in my
> main page depending on a request parameter:
> 
> <xsp:logic>
>        	String page = <xsp-request:get-parameter name="page"/>;
>        	if(page==null || page=="") page =
> "cocoon:/pagecontent/kategorien.xsp";
> </xsp:logic>    
> 
> But then I have a problem. How can I pass the variable 'page' to the
> <cinclude>-tag?
> 
> <cinclude:include src=" <-- here I don't know how to do it :((
> 
> Any help will be appreciated
> 
> Regards
> 
> Jan



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org