简体   繁体   中英

How to set <s:param> value of <s:url> tag dynamically using javascript in struts2

I am new to Struts2.I unable to pass tag value dynamically through javascript.I have done this way

<s:url id="temId" action="updateProduct.action" var="productTag"> 
<s:param name="prodId"><s:property value="hdnId"/></s:param>
</s:url>
<s:hidden name="hdnId"/>

this hidden field value is populated through javascript function onclick on gridrow This hidden field is storing value properly.But it is not showing inside of param tag.please give some possible solution

AFAIK Struts2 is server side only whereas JavaScript is client side. Thus you can't create/fill struts tags using JavaScript (unless you execute it on the server side which wouldn't make sense IMHO).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM