You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by "Hubert Trzewik (Prosystel)" <ht...@prosystel.com.pl> on 2004/01/09 12:09:17 UTC

Null instead of value while passing map:parameter to XSPAction

I still cannot get ride with passing parameters from sitemap to XSPAction.
In this simple example below teststring_logic gets "null" value instead of
"4213". Why?

-- part of SITEMAP --
 <map:pipeline>
  <map:match pattern="action.dosomething">
   <map:parameter name="teststring" value="4213"/>
   <map:act type="xsp-action" src="serverpages/actions/dosomething.xsp">
    <!-- on action:set-success -->
      <map:redirect-to uri="welcome"/>
   </map:act>
   <!-- on action:set-failure -->
    <map:redirect-to uri="welcome"/>
  </map:match>
 </map:pipeline>



-- DOSOMETHING.XSP --
<xsp:page
          language="java"
          xmlns:xsp="http://apache.org/xsp"
          xmlns:esql="http://apache.org/cocoon/SQL/v2"
          xmlns:xsp-request="http://apache.org/xsp/request/2.0"
          xmlns:util="http://apache.org/xsp/util/2.0"
          xmlns:action="http://apache.org/cocoon/action/1.0"
          xmlns:dosomething="http://dosomething"
>


<dummypage>

 <xsp:logic>
  String teststring_logic = <util:get-sitemap-parameter name="teststring"/>;
 </xsp:logic>

<dosomething:do><xsp:expr>teststring_logic</xsp:expr></dosomething:do>
<action:set-success/>

</dummypage>

</xsp:page>



--
Hubert Trzewik
Prosystel Sp. z o.o.
hubert.trzewik@prosystel.com.pl


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


Re: Null instead of value while passing map:parameter to XSPAction

Posted by Olivier Billard <ob...@rennes.jouve.fr>.
No, that's the same way with matchers, selectors and friends : to set a parameter, just 
add a <map:parameter>, but the component must deal with that parameter of course.

On 09/01/2004 12:17, Hubert Trzewik (Prosystel) wrote:

> Works. I thought that <map:parameter> element inside <map:act> will be
> 'executed' after action do <action:set-success/>.
> 
> --
> Hubert Trzewik
> Prosystel Sp. z o.o.
> hubert.trzewik@prosystel.com.pl
> ----- Original Message ----- 
> From: "Olivier Billard" <ob...@rennes.jouve.fr>
> To: <us...@cocoon.apache.org>
> Sent: Friday, January 09, 2004 12:11 PM
> Subject: Re: Null instead of value while passing map:parameter to XSPAction
> 
> 
> 
>>You're passing the parameter to the matcher instead of the action...
>>try :
>>   <map:pipeline>
>>    <map:match pattern="action.dosomething">
>>     <cut-it-here/>
>>     <map:act type="xsp-action" src="serverpages/actions/dosomething.xsp">
>>       <paste-it-there/>
>>       <map:parameter name="teststring" value="4213"/>
>>      <!-- on action:set-success -->
>>        <map:redirect-to uri="welcome"/>
>>     </map:act>
>>     <!-- on action:set-failure -->
>>      <map:redirect-to uri="welcome"/>
>>    </map:match>
>>   </map:pipeline>
>>
>>
>>On 09/01/2004 12:09, Hubert Trzewik (Prosystel) wrote:
>>
>>>I still cannot get ride with passing parameters from sitemap to
> 
> XSPAction.
> 
>>>In this simple example below teststring_logic gets "null" value instead
> 
> of
> 
>>>"4213". Why?
>>>
>>>-- part of SITEMAP --
>>> <map:pipeline>
>>>  <map:match pattern="action.dosomething">
>>>   <map:parameter name="teststring" value="4213"/>
>>>   <map:act type="xsp-action" src="serverpages/actions/dosomething.xsp">
>>>    <!-- on action:set-success -->
>>>      <map:redirect-to uri="welcome"/>
>>>   </map:act>
>>>   <!-- on action:set-failure -->
>>>    <map:redirect-to uri="welcome"/>
>>>  </map:match>
>>> </map:pipeline>
>>>
>>>
>>>
>>>-- DOSOMETHING.XSP --
>>><xsp:page
>>>          language="java"
>>>          xmlns:xsp="http://apache.org/xsp"
>>>          xmlns:esql="http://apache.org/cocoon/SQL/v2"
>>>          xmlns:xsp-request="http://apache.org/xsp/request/2.0"
>>>          xmlns:util="http://apache.org/xsp/util/2.0"
>>>          xmlns:action="http://apache.org/cocoon/action/1.0"
>>>          xmlns:dosomething="http://dosomething"
>>>
>>>
>>>
>>><dummypage>
>>>
>>> <xsp:logic>
>>>  String teststring_logic = <util:get-sitemap-parameter
> 
> name="teststring"/>;
> 
>>> </xsp:logic>
>>>
>>><dosomething:do><xsp:expr>teststring_logic</xsp:expr></dosomething:do>
>>><action:set-success/>
>>>
>>></dummypage>
>>>
>>></xsp:page>
>>>
>>>
>>>
>>>--
>>>Hubert Trzewik
>>>Prosystel Sp. z o.o.
>>>hubert.trzewik@prosystel.com.pl
>>
>>
>>-- 
>>Olivier BILLARD
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>


-- 
Olivier BILLARD



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


Re: Null instead of value while passing map:parameter to XSPAction

Posted by "Hubert Trzewik (Prosystel)" <ht...@prosystel.com.pl>.
Works. I thought that <map:parameter> element inside <map:act> will be
'executed' after action do <action:set-success/>.

--
Hubert Trzewik
Prosystel Sp. z o.o.
hubert.trzewik@prosystel.com.pl
----- Original Message ----- 
From: "Olivier Billard" <ob...@rennes.jouve.fr>
To: <us...@cocoon.apache.org>
Sent: Friday, January 09, 2004 12:11 PM
Subject: Re: Null instead of value while passing map:parameter to XSPAction


> You're passing the parameter to the matcher instead of the action...
> try :
>    <map:pipeline>
>     <map:match pattern="action.dosomething">
>      <cut-it-here/>
>      <map:act type="xsp-action" src="serverpages/actions/dosomething.xsp">
>        <paste-it-there/>
>        <map:parameter name="teststring" value="4213"/>
>       <!-- on action:set-success -->
>         <map:redirect-to uri="welcome"/>
>      </map:act>
>      <!-- on action:set-failure -->
>       <map:redirect-to uri="welcome"/>
>     </map:match>
>    </map:pipeline>
>
>
> On 09/01/2004 12:09, Hubert Trzewik (Prosystel) wrote:
> > I still cannot get ride with passing parameters from sitemap to
XSPAction.
> > In this simple example below teststring_logic gets "null" value instead
of
> > "4213". Why?
> >
> > -- part of SITEMAP --
> >  <map:pipeline>
> >   <map:match pattern="action.dosomething">
> >    <map:parameter name="teststring" value="4213"/>
> >    <map:act type="xsp-action" src="serverpages/actions/dosomething.xsp">
> >     <!-- on action:set-success -->
> >       <map:redirect-to uri="welcome"/>
> >    </map:act>
> >    <!-- on action:set-failure -->
> >     <map:redirect-to uri="welcome"/>
> >   </map:match>
> >  </map:pipeline>
> >
> >
> >
> > -- DOSOMETHING.XSP --
> > <xsp:page
> >           language="java"
> >           xmlns:xsp="http://apache.org/xsp"
> >           xmlns:esql="http://apache.org/cocoon/SQL/v2"
> >           xmlns:xsp-request="http://apache.org/xsp/request/2.0"
> >           xmlns:util="http://apache.org/xsp/util/2.0"
> >           xmlns:action="http://apache.org/cocoon/action/1.0"
> >           xmlns:dosomething="http://dosomething"
> >
> >
> >
> > <dummypage>
> >
> >  <xsp:logic>
> >   String teststring_logic = <util:get-sitemap-parameter
name="teststring"/>;
> >  </xsp:logic>
> >
> > <dosomething:do><xsp:expr>teststring_logic</xsp:expr></dosomething:do>
> > <action:set-success/>
> >
> > </dummypage>
> >
> > </xsp:page>
> >
> >
> >
> > --
> > Hubert Trzewik
> > Prosystel Sp. z o.o.
> > hubert.trzewik@prosystel.com.pl
>
>
> -- 
> Olivier BILLARD
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>


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


Re: Null instead of value while passing map:parameter to XSPAction

Posted by Olivier Billard <ob...@rennes.jouve.fr>.
You're passing the parameter to the matcher instead of the action...
try :
   <map:pipeline>
    <map:match pattern="action.dosomething">
     <cut-it-here/>
     <map:act type="xsp-action" src="serverpages/actions/dosomething.xsp">
       <paste-it-there/>
       <map:parameter name="teststring" value="4213"/>
      <!-- on action:set-success -->
        <map:redirect-to uri="welcome"/>
     </map:act>
     <!-- on action:set-failure -->
      <map:redirect-to uri="welcome"/>
    </map:match>
   </map:pipeline>


On 09/01/2004 12:09, Hubert Trzewik (Prosystel) wrote:
> I still cannot get ride with passing parameters from sitemap to XSPAction.
> In this simple example below teststring_logic gets "null" value instead of
> "4213". Why?
> 
> -- part of SITEMAP --
>  <map:pipeline>
>   <map:match pattern="action.dosomething">
>    <map:parameter name="teststring" value="4213"/>
>    <map:act type="xsp-action" src="serverpages/actions/dosomething.xsp">
>     <!-- on action:set-success -->
>       <map:redirect-to uri="welcome"/>
>    </map:act>
>    <!-- on action:set-failure -->
>     <map:redirect-to uri="welcome"/>
>   </map:match>
>  </map:pipeline>
> 
> 
> 
> -- DOSOMETHING.XSP --
> <xsp:page
>           language="java"
>           xmlns:xsp="http://apache.org/xsp"
>           xmlns:esql="http://apache.org/cocoon/SQL/v2"
>           xmlns:xsp-request="http://apache.org/xsp/request/2.0"
>           xmlns:util="http://apache.org/xsp/util/2.0"
>           xmlns:action="http://apache.org/cocoon/action/1.0"
>           xmlns:dosomething="http://dosomething"
> 
> 
> 
> <dummypage>
> 
>  <xsp:logic>
>   String teststring_logic = <util:get-sitemap-parameter name="teststring"/>;
>  </xsp:logic>
> 
> <dosomething:do><xsp:expr>teststring_logic</xsp:expr></dosomething:do>
> <action:set-success/>
> 
> </dummypage>
> 
> </xsp:page>
> 
> 
> 
> --
> Hubert Trzewik
> Prosystel Sp. z o.o.
> hubert.trzewik@prosystel.com.pl


-- 
Olivier BILLARD



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