【问题标题】:How to get the all ListBox Value on the Server Side in GWT如何在 GWT 中获取服务器端的所有 ListBox 值
【发布时间】:2012-06-11 12:22:03
【问题描述】:

我正在使用 GWT

3 列表框添加到容器 (verticalPanel) 中。容器被添加到 formPanel。

这些列表框有多个值。

在服务器端我有这个代码。

ServletFileUpload 上传 = new ServletFileUpload();

        FileItemIterator iterator = upload.getItemIterator(request);
        while (iterator.hasNext()) {
            FileItemStream item = iterator.next();
             stream = item.openStream();

            if (item.isFormField()) {
                log.warning("Got a form field: " + item.getFieldName() + item.getName() + item.);
                System.out.println(" chk  " +item.getFieldName() +"  =  "+ Streams.asString(item.openStream()));



            }else{

                log.warning("Got an uploaded file: " + item.getFieldName()
                        + ", name = " + item.getName());
                fileName = item.getName();
                mimetype = item.getContentType();



            }
        }

    } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }

但我只能得到列表框的第一个值

请告诉我如何获取列表框的所有值

注意:我不能通过 RPC 发送列表框,因为这些列表框与要发送到服务器和服务器到外部存储库的文件有关。

有人请帮忙。

【问题讨论】:

  • @HardikMishra:你能帮我解决这个问题吗?

标签: java gwt servlets gwt2 formpanel


【解决方案1】:

如果您在运行时向列表框添加值,请管理其后面的列表并将列表框中的值添加到该列表并将该列表传递给服务器。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2017-05-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-07-13
    相关资源
    最近更新 更多