问题
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.
回答1:
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.
来源:https://stackoverflow.com/questions/10980022/how-to-get-the-all-listbox-value-on-the-server-side-in-gwt