Search code examples
struts2struts-action

Call a method passing a parameter inside jsp with struts 2


I have a scenario where I need to call a method of an Action class. Below is the code.

<s:if test="#session['EXECUTOR'] != null">  
<tr>
    <td width="80%">
    Test: 
    <!-- <s:property value="#moveETHAction_fetchExecutorData(#session['EXECUTOR'])" /> -->
    <s:push value="#moveETHAction_fetchExecutorData(#session['EXECUTOR'])">
         <s:property value="top">
    </s:push>
    </td>
</tr>   
</s:if>

However it's not working, throwing some Jasper Exception -" According to TLD, tag s:property must be empty, but is not"

How do i call the method and return a String data?


Solution

  • shouldn't it be:

    <s:property value="top"/>
    

    in stead of

    <s:property value="top">