D
Dan
Within a portlet, I have the need to upload one file to several
folders which can be selected in a list box. I have decided
to go with V1.1.1 of the Jakarta Commons File Upload classes.
My form contains several elements, including the multiple list
box. Here is my form tag:
<form method="post" enctype="multipart/form-data"
action="/DocUploadPortlet/UploadSelectedFiles.jsp">
Within the jsp, is there any way to get all of the items which
have been selected in the list box? Here is a snippet of code
from the jsp (listed in the "action" attribute above):
List items = upload.parseRequest(request);
Iterator iter = items.iterator();
while (iter.hasNext()) {
FileItem item = (FileItem) iter.next();
out.print("getFieldName(): " + item.getFieldName() + "<br>");
out.print("getName()" + item.getName() + "<br>");
out.print("getString()" + item.getString() + "<br><br>");
}
The above code does print the names of all form elements. But
in the case of the multiple list box, only its first selected value
is printed. Is there any way to get all of the selected values?
Thanks,
Dan
folders which can be selected in a list box. I have decided
to go with V1.1.1 of the Jakarta Commons File Upload classes.
My form contains several elements, including the multiple list
box. Here is my form tag:
<form method="post" enctype="multipart/form-data"
action="/DocUploadPortlet/UploadSelectedFiles.jsp">
Within the jsp, is there any way to get all of the items which
have been selected in the list box? Here is a snippet of code
from the jsp (listed in the "action" attribute above):
List items = upload.parseRequest(request);
Iterator iter = items.iterator();
while (iter.hasNext()) {
FileItem item = (FileItem) iter.next();
out.print("getFieldName(): " + item.getFieldName() + "<br>");
out.print("getName()" + item.getName() + "<br>");
out.print("getString()" + item.getString() + "<br><br>");
}
The above code does print the names of all form elements. But
in the case of the multiple list box, only its first selected value
is printed. Is there any way to get all of the selected values?
Thanks,
Dan