You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Baer Peter <Pe...@nbg.sbs.de> on 2002/03/19 14:24:01 UTC
Re: RE: [XSP] Sitemap parameter passed to XSP page
We need a way to push parameters from the sitemap to XSP via a generator
(of type serverpages).
We can catch session and request parameters using session.getParameter()
or request.getParameter(). With parameters.getParameter() we had no
success, however. Nothing happens using the following configuration.
Any suggestions most appreciated!
Our sitemap looks like this:
<map:match pattern="application/*">
<map:generate type="serverpages" src="record.xsp">
<map:parameter name="user_name" value="admin"/>
</map:generate>
</map:match>
Our XSP file looks like:
<xsp:logic>
try {
String myParam = parameters.getParameter("user_name");
}
catch (Exception e)
{ }
</xsp:logic>
We also tried this:
<parameters:get-parameter name="user_name"/>
Regards
Peter
>Cool, thanks!
>By the way, why do I need an <xsp:expr> here since I'm already in an
><xsp:logic> node here? To do some escaping on the returned string?
>
> Pascal.
>
>>-----Original Message-----
>>From: Jan Normann Nielsen [mailto:cocoon@dubbekarl.dk]
>>Sent: Saturday, February 23, 2002 11:45 AM
>>To: cocoon-users@xml.apache.org
>>Subject: SV: [XSP] Sitemap parameter passed to XSP page
>>
>>
>>Hi Pascal
>>
>>You can access the parameters variable from your XSP page, just like
>>you
>>would do in an Action. Example:
>>
>><xsp:logic>
>>String myParam =
>><xsp:expr>parameters.getParameter("my-param")</xsp:expr>
>></xsp:logic>
>>
>>to access the "my-param" sitemap parameter.
>>
>>Best regards,
>>Jan Nielsen
>>
>>> -----Oprindelig meddelelse-----
>>> Fra: Pascal Davoust [mailto:davoustp@yahoo.com]
>>> Sendt: 23. februar 2002 00:13
>>> Til: Cocoon Users
>>> Emne: [XSP] Sitemap parameter passed to XSP page
>>>
>>>
>>> Hi,
>>>
>>> I'm trying to get a parameter passed from the sitemap to the XSP
>>page I'm
>>> writing.
>>> The purpose is to have the following kind of stuff in the sitemap:
>>>
>>> <map:match pattern="record/*">
>>> <map:generate type="serverpages" src="record.xsp">
>>> <map:parameter name="record/id" value="{../1}"/>
>>> </map:generate>
>>> </map:match>
>>>
>>> (the <map:parameter> is my own guess about how to pass the param to
>>the
>>> generator... :o)
>>>
>>> And use the "record/id" parameter in my XSP (how?).
>>> I guess it's real common stuff, but can't find any example or >>hint...
>>>
>>> Thanks,
>>>
>>> Pascal.
--
+-------------------------------+-------------------------------------+
| >>> mailto:Peter.CA.Baer@Siemens.com <<< |
+---------------------------------------------------------------------+
---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
Re: RE: [XSP] Sitemap parameter passed to XSP page
Posted by Christian SCHRÖTER <ch...@nbg.sbs.de>.
Am Dienstag, 19. März 2002 17:56 schrieben Sie:
> > From: Baer Peter [mailto:Peter.Baer@nbg.sbs.de]
> >
> > We need a way to push parameters from the sitemap to XSP via a
>
> generator
>
> > (of type serverpages).
> >
> > We can catch session and request parameters using
>
> session.getParameter()
>
> > or request.getParameter(). With parameters.getParameter() we had no
> > success, however. Nothing happens using the following configuration.
> >
> > Any suggestions most appreciated!
> >
> >
> > Our sitemap looks like this:
> >
> > <map:match pattern="application/*">
> > <map:generate type="serverpages" src="record.xsp">
> > <map:parameter name="user_name" value="admin"/>
> > </map:generate>
> > </map:match>
> >
> >
> > Our XSP file looks like:
> >
> > <xsp:logic>
> > try {
> > String myParam = parameters.getParameter("user_name");
> > }
> > catch (Exception e)
> > { }
> > </xsp:logic>
>
> Where you have this <xp:logic> tag? In what part of XSP? You must know
> that the all <xsp:logic> tags right after <xsp:page> goes to class
> definition, not the XSP body.
>
> That's working for me:
>
> <page xmlns:cinclude="http://apache.org/cocoon/include/1.0">
>
> <body> <!-- NOTE: Document root tag here!!!! -->
> <xsp:logic>
> try{
> String color = parameters.getParameter("color");
>
we did it like this, but it doesnt work here. (Our XSP file looks like = we
do not post the whole sources)
>
> Vadim
>
> > We also tried this:
> >
> > <parameters:get-parameter name="user_name"/>
> >
> > Regards
> > Peter
>
> ...
>
>
> ---------------------------------------------------------------------
> 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: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
--
------------------------------------------------------------
Schröter, Christian
Siemens Business Services GmbH & Co. OHG
SBS D BS ECS 3
Tel.: +49 911 654 2355
Fax: +49 911 654 2108
Mobil: +49 160 97843762
eMail: Christian.Schroeter@nbg.sbs.de
------------------------------------------------------------
---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>
RE: RE: [XSP] Sitemap parameter passed to XSP page
Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Baer Peter [mailto:Peter.Baer@nbg.sbs.de]
>
> We need a way to push parameters from the sitemap to XSP via a
generator
> (of type serverpages).
>
> We can catch session and request parameters using
session.getParameter()
> or request.getParameter(). With parameters.getParameter() we had no
> success, however. Nothing happens using the following configuration.
>
> Any suggestions most appreciated!
>
>
> Our sitemap looks like this:
>
> <map:match pattern="application/*">
> <map:generate type="serverpages" src="record.xsp">
> <map:parameter name="user_name" value="admin"/>
> </map:generate>
> </map:match>
>
>
> Our XSP file looks like:
>
> <xsp:logic>
> try {
> String myParam = parameters.getParameter("user_name");
> }
> catch (Exception e)
> { }
> </xsp:logic>
Where you have this <xp:logic> tag? In what part of XSP? You must know
that the all <xsp:logic> tags right after <xsp:page> goes to class
definition, not the XSP body.
That's working for me:
<page xmlns:cinclude="http://apache.org/cocoon/include/1.0">
<body> <!-- NOTE: Document root tag here!!!! -->
<xsp:logic>
try{
String color = parameters.getParameter("color");
Vadim
>
>
> We also tried this:
>
> <parameters:get-parameter name="user_name"/>
>
> Regards
> Peter
>
...
---------------------------------------------------------------------
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: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>