简体   繁体   English

设定方法 <s:param> 的价值 <s:url> 在struts2中使用javascript动态标记

[英]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 我是Struts2的新手,我无法通过javascript动态传递标签值。

<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 此隐藏字段值是通过javascript函数onclick在gridrow上填充的。此隐藏字段正确存储了值。但是未在param标签内部显示。请提供一些可能的解决方案

AFAIK Struts2 is server side only whereas JavaScript is client side. AFAIK Struts2仅在服务器端,而JavaScript在客户端。 Thus you can't create/fill struts tags using JavaScript (unless you execute it on the server side which wouldn't make sense IMHO). 因此,您无法使用JavaScript创建/填充struts标记(除非您在服务器端执行它,恕我直言)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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