如何获取GWT中服务器端的所有ListBox值 [英] How to get the all ListBox Value on the Server Side in GWT

查看:105
本文介绍了如何获取GWT中服务器端的所有ListBox值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用GWT



<3>列表框是在容器(verticalPanel)中添加的。容器被添加到formPanel。



这些列表框有多个值。



在服务器端,我

ServletFileUpload upload = 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()));


$ b} else {

log.warning(有上传的文件:+ item.getFieldName()
+ ,name =+ item.getName());
fileName = item.getName();
mimetype = item.getContentType();





$ b catch(例外e){
// TODO自动生成的catch块
e.printStackTrace();
}

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



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

注意:I无法通过RPC发送Listbox导致这些列表框与发送到服务器和服务器的文件相关联到外部存储库。



一些plz帮助。

解决方案

如果您在运行时将值添加到列表框中管理列表behiend并将列表框中的值添加到该列表并传递该列表到服务器。


I am using GWT

3 Listbox are Add in container (verticalPanel) . container is added to formPanel.

These List box has more then one value.

On the server side i Have this code.

ServletFileUpload upload = 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();
    }

but i can get get only the first value of the List box

Plz tell me how to get all the values of the list box

Note : I cant send Listbox through RPC cause these list box is related to file which is to send to server and server to external repository.

Some one plz Help.

解决方案

if you are adding values to list box at run time manage a list behiend it and add values in the list box to that list and pass that list to the sever.

这篇关于如何获取GWT中服务器端的所有ListBox值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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