【发布时间】:2022-01-28 01:04:20
【问题描述】:
我正在使用<s:url> 创建一个类似removeAction.action?id=10 的URL,<s:form> 元素中的action 属性应该使用它。
这里的问题是当<s:form> 转换为<form> 元素时,我只能看到动作属性值为action="/project/removeAction.action"。 id 参数正在被修剪。我想要的结果是action="/project/removeAction.action?id=10"
<s:url var="actionUrl" action="removeAction" includeContext="false">
<s:param name="id" value="%{id}" />
</s:url>
<s:form action="%{actionUrl}" method="post" enctype="multipart/form-data" >
<div>
<s:file name="imgUpload"/>
<s:submit> upload </submit>
</div>
</s:form>
最近我将 struts2 核心版本升级到 2.3.12,我遇到了这个问题。此问题在版本 2.3.4.1 之后开始
而且我不想使用hidden 属性来传递参数,因为当文件很大要上传时,此参数会丢失。
有什么解决办法吗?
【问题讨论】:
-
也许这是你真正的问题:
And I don't want to use a hidden attribute to pass the parameter as this parameter get lost when the file size is big to upload.?
标签: jsp parameters struts2