0

I tried :

<s:set name="ordersymbol" value="EURUSD" var="ordersymbol"/>
    <s:push value="@dao.positions@positionsO(%{#ordersymbol})">

<s:set name="ordersymbol" value="EURUSD" var="ordersymbol"/>
    <s:push value="@dao.positions@positionsO(#ordersymbol)">

<s:set name="ordersymbol" value="EURUSD" var="ordersymbol"/>
    <s:push value="@dao.positions@positionsO(ordersymbol)">

<s:set name="ordersymbol" value="EURUSD" var="ordersymbol"/>
    <s:push value="@dao.positions@positionsO(%{ordersymbol})">

Neither of the above four worked, the method always get null parameter.

Although if I try

<s:push value="@dao.positions@positionsO('EURUSD')">

it works fine.

Roman C
  • 49,761
  • 33
  • 66
  • 176
coding_idiot
  • 13,526
  • 10
  • 65
  • 116

4 Answers4

1

Have you tried with

<s:set name="ordersymbol" value="EURUSD" var="ordersymbol"/>
    <s:push value="@dao.positions@positionsO('%{#ordersymbol}')">

?

Andrea Ligios
  • 49,480
  • 26
  • 114
  • 243
1

I realize it's an old question... But:

The reason in doesn't work is that "value is an object." The correct <s:set/> would be:

<s:set var="ordersymbol" value="'EURUSD'" />

and the correct <s:push/> is the second one.

dmansfield
  • 1,108
  • 10
  • 22
0

I figured out an alternative by the way.

<s:set value="@dao.positions@positionsO('EURUSD')" var="symbol1"/>
    <s:push value="#symbol1">

In case of using an iterator

<s:iterator value="#{'EURUSD':'EURUSD','GBPUSD':'GBPUSD'}>
<s:set value="@dao.positions@positionsO(value)" var="symbol1"/>
    <s:push value="#symbol1">...</s:push>
</s:iterator>

But I still have to figure out a way, incase I use a list in iterator, instead of a map as above.

coding_idiot
  • 13,526
  • 10
  • 65
  • 116
0

Try

<s:push value="%{@dao.positions@positionsO(#ordersymbol)}">

something similar but taking an expression at whole and evaluate it.

Roman C
  • 49,761
  • 33
  • 66
  • 176