0

リンクを介してid-propertyの値を送信しようとしました

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

また

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

しかし、何も機能しません。手伝って頂けますか?

4

1 に答える 1

4

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>
于 2012-07-22T17:13:20.037 に答える