如何解决一页中有多个表单enctype =“ multipart / form-data
我在同一页面中有两个inputFile。 保存文件时,第一个文件不为空,但是保存第二个文件时,该文件始终为空。 主模板在表单中包含enctype =“ multipart / form-data”。 谢谢。
<div class="form-horizontal">
<div class="form-group">
<label class="col-sm-2 control-label">Text</label>
<div class="col-sm-9">
<span class="btn fileinput-button">
<h:form enctype="multipart/form-data">
<h:inputFile name="firstFile" type="file"
value="#{documentUtilePresenter.firstFile}"/>
</h:form>
</span>
<h:commandLink id="btnSaveFirstFile" action="#{documentUtilePresenter.saveFirstFile()}"
class="btn btn-primary">
</h:commandLink>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">Text</label>
<div class="col-sm-9">
<span class="btn fileinput-button">
<h:form enctype="multipart/form-data">
<h:inputFile name="secondFile" value="#documentUtilePresenter.userGuideFile}"/>
</h:form>
</span>
<h:commandLink id="btnSaveSecondFile" action="#{documentUtilePresenter.saveSecondFile()}"
class="btn btn-primary">
</h:commandLink>
</div>
</div>
</div>
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。