多个文件上传(条带化) [英] Multiple file upload(stripes)

查看:186
本文介绍了多个文件上传(条带化)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试上传文件,该文件将使用Stripes框架接受多个文件.我有一个文件上传工作.我正在尝试了解文档,用于上传多个文件.

根据文档,我所需要做的就是将单个文件示例修改为:

<stripes:form>
    <c:forEach ... varStatus="loop">
        ...
        <stripes:file name="newAttachments[${loop.index}]"/>
        ...
    </stripes:form>

ActionBean

private List<FileBean> newAttachments;

public List<FileBean> getNewAttachments() {
    return this.newAttachments;
}

public void setNewAttachment(List<FileBean> newAttachments) {
    this.newAttachments = newAttachments;
}

要使此示例正常工作,我需要替换什么...(特别是forEach循环中的那个)?谢谢.

解决方案

可能应该起作用: <c:forEach begin="1" end="3" varStatus="loop">

请参见为每个文档添加标签

I am trying to make a file upload that will accept multiple files using the stripes framework. I have a single file upload working. I am trying to understand the Documentation for multiple file upload.

According to the doc, all I need to do is modify single file example to:

<stripes:form>
    <c:forEach ... varStatus="loop">
        ...
        <stripes:file name="newAttachments[${loop.index}]"/>
        ...
    </stripes:form>

ActionBean

private List<FileBean> newAttachments;

public List<FileBean> getNewAttachments() {
    return this.newAttachments;
}

public void setNewAttachment(List<FileBean> newAttachments) {
    this.newAttachments = newAttachments;
}

What do I need to replace the ...(in particular, the one in the forEach loop) with to get this example working? Thanks.

解决方案

Probably that should work: <c:forEach begin="1" end="3" varStatus="loop">

see Tag forEach doc

这篇关于多个文件上传(条带化)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆