<xsp:page> String id = parameters.getParameter("id", "defaultvalue"); </xsp:page>

Kind Regards,
Jan

Lars Huttar wrote:

Dear Cocoonists,
I'm trying to pass sitemap parameters to an XSP page:

     <map:match pattern="data/language-entry/*">
       <map:generate src="sources/language-entry.xsp" type="serverpages">
         <map:parameter name="id" value="{1}" />
       </map:generate>
       <map:serialize type="xml" />
     </map:match>

But in the xsp page, where I use <xsp-request:get-parameter name="id"/>,
the result is nothing (empty string).
This makes sense, since the parameter I'm looking for is
not a request parameter, so xsp-request shouldn't find it.

But then, how DO I pick up sitemap parameters?
(If I am using the term "sitemap parameter" right?)
It is documented in various places, including the xsp.xsl
logicsheet, that "parameters - parameters defined in the sitemap"
is one of the "Built-in parameters available for use" in XSP. But
nowhere can I find how to access it/them.

Any help is appreciated!

You are probably wondering why I don't use a request parameter,
e.g.
     <map:match pattern="data/language-entry/*">
       <map:generate src="sources/language-entry.xsp" type="serverpages">
         <map:parameter name="id" value="{1}" />
       </map:generate>
       <map:serialize type="xml" />
     </map:match>

instead of a sitemap parameter.
That is an option.
I've been avoiding it because it would mean that when it
comes to using that parameter as part of a filename, for reading
or writing, I would have to take extra steps to make sure
someone doesn't try to sneak in values like "foo/../../etc"
and try to get access to files they shouldn't.

Thanks,
Lars


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






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



Reply via email to