简体   繁体   English

通过发送参数值struts1 <html:link>

[英]Send parameter value struts1 via <html:link>

I tried to send value of id-property via link as 我试图通过链接发送id属性值

<html:link action="action?method=view&amp;newsID='<bean:write name="news" property="id"/>'">View</html:link>

or 要么

<input type="hidden" name="newsID" value='<bean:write name="news" property="id"/>'/>
                <html:link
                    action="action?method=view&amp;newsID=${newsID}">
                View
                </html:link>

But nothing work. 但是没有任何作用。 Can you help me? 你能帮助我吗?

Do yourself a favor, and use the JSTL: 帮个忙,使用JSTL:

<c:url var="theUrl" value="/action.do">
    <c:param name="method" value="view"/>
    <c:param name="newsID" value="${news.id}"/>
</c:url>
<a href="${fn:escapeXml(theUrl)}">View</a>

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

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