how to pass parameter value from a jquery function to struts2 url tag

后端 未结 1 596
庸人自扰
庸人自扰 2021-01-26 00:33

i am trying to pass parameter from a jquery function. Everything is fine but only problem is passing the parameter value rowObject.themeScreenshot

          


        
相关标签:
1条回答
  • 2021-01-26 01:15

    Struts 2 tags are evaluated at page render time, which is far before your script runs.

    If you check the source code of the page you will see those tags have been converted to regular html elements. So it the para javascript variable would not be evaluated.

    You can try to update the return line to

    return "<a style='cursor:pointer;' onClick='javascript:openDialog("+cellvalue+")'><img src='<s:url action='ImageAction' namespace='/myimage/secure'></s:url>" + "?imageId="+para+ "'></a>";
    
    0 讨论(0)
提交回复
热议问题