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:[EMAIL PROTECTED]] >>Sent: Saturday, February 23, 2002 11:45 AM >>To: [EMAIL PROTECTED] >>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:[EMAIL PROTECTED]] >>> 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:[EMAIL PROTECTED] <<< | +---------------------------------------------------------------------+ --------------------------------------------------------------------- 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: <[EMAIL PROTECTED]> For additional commands, e-mail: <[EMAIL PROTECTED]>