cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carlos Dias" <cd...@pontoc.pt>
Subject Re: Problems passing parameters to XSP
Date Tue, 20 Apr 2004 15:08:43 GMT
Thanks for the answer.
I read what you said about the "cocoon:/" protocol, I call the xsp directly and it works fine.
The point is that I had implemented a generic pipeline for xsp files, that's why I used the
protocol.
The generic pipeline for xsp files is:
<map:match pattern="*.jsp">
    <map:generate src="generators/dynamic/jsp/{1}.jsp" type="jsp" mime-type="text/html"/>
    <map:serialize/> 
</map:match>

Can anybody tell me the changes that needs to support parameters?

Carlos Dias
  ----- Original Message ----- 
  From: Jan Hoskens 
  To: users@cocoon.apache.org ; Carlos Dias 
  Sent: Tuesday, April 20, 2004 1:20 PM
  Subject: Re: Problems passing parameters to XSP


  I tend to use this instead of <util:.../>:

  String s = parameters.getParameter("my_sitemap_parameter", "default_value");

  This does work for me. 
  I wonder why you're using the "cocoon:/" protocol, because the docs say:
   cocoon:/ - get a pipeline from the current sitemap 

  I don't think you want a pipeline in your generator there, but just a page relative to your
sitemap, so omit the protocol.

  Kind Regards,
  Jan


  ----- Original Message ----- 
    From: Carlos Dias 
    To: users@cocoon.apache.org 
    Sent: Tuesday, April 20, 2004 1:55 PM
    Subject: Problems passing parameters to XSP


    Hi,
    I know that this is a very well documented subject, but I try it, and doesn't work.

    My pipeline is:
       <map:match pattern="test-*-*">
        <map:generate src="cocoon:/select_bookmark_list.xsp" strip-root="false">
         <map:parameter name="user_id" value="{1}"/>
         <map:parameter name="app_id" value="{2}"/>
        </map:generate>
        <map:serialize type="xml"/>
       </map:match>

    My xsp file is:
     <select>
      <xsp:logic>
       String app_id = <util:get-sitemap-parameter name="app_id"/>;
       String user_id = <util:get-sitemap-parameter name="user_id"/>;
       <val1><xsp:expr>app_id</xsp:expr></val1>
       <val2><xsp:expr>user_id</xsp:expr></val2>
      </xsp:logic>
     </select>

    The xsp can't pull the parameters. The result is an empty string. I already try to use
the parameters.getParameter("paramname")
    but the problem is the same. Can anybody tell me what's wrong here?!

    Thanks,
    Carlos Dias

Mime
View raw message