RE: exec resultproperty only set once

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

RE: exec resultproperty only set once

Damien  Bargiacchi
I figured out a workaround. On each loop, I generated a new property name
and stored the results there.

In my loop I have something like this"

<j:forEach items="${item_list}" var="cur" indexVar="num">
        <j:set var="test_res_prop_name" value="testTrans_res_${num}"/>
        <j:set var="test_out_prop_name" value="testTrans_out_${num}"/>
        <j:set var="test_err_prop_name" value="testTrans_err_${num}"/>
                <exec executable="ssh"
outputproperty="${test_out_prop_name}"
       
errorproperty="${test_err_prop_name}"
       
resultproperty="${test_res_prop_name}">
                        <!--...-->
                </exec>
                <echo message="Return Code:
${context.getVariable(test_res_prop_name)}"/>
                <echo message="    Std Out:
${context.getVariable(test_out_prop_name)}"/>
                <echo message="    Err Out:
${context.getVariable(test_err_prop_name)}"/>
</j:forEach>

        ...Damien

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: exec resultproperty only set once

Dan Tran
thanks for the tip

-D

On 5/9/05, Damien Bargiacchi <[hidden email]> wrote:

> I figured out a workaround. On each loop, I generated a new property name
> and stored the results there.
>
> In my loop I have something like this"
>
> <j:forEach items="${item_list}" var="cur" indexVar="num">
>        <j:set var="test_res_prop_name" value="testTrans_res_${num}"/>
>        <j:set var="test_out_prop_name" value="testTrans_out_${num}"/>
>        <j:set var="test_err_prop_name" value="testTrans_err_${num}"/>
>                <exec executable="ssh"
> outputproperty="${test_out_prop_name}"
>
> errorproperty="${test_err_prop_name}"
>
> resultproperty="${test_res_prop_name}">
>                        <!--...-->
>                </exec>
>                <echo message="Return Code:
> ${context.getVariable(test_res_prop_name)}"/>
>                <echo message="    Std Out:
> ${context.getVariable(test_out_prop_name)}"/>
>                <echo message="    Err Out:
> ${context.getVariable(test_err_prop_name)}"/>
> </j:forEach>
>
>        ...Damien
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]