commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anand Shankar <anand.al....@gmail.com>
Subject File Upload
Date Fri, 09 Oct 2009 06:03:02 GMT
Subject: problem in retrieving data from <selecet multiple> tag using common
file upload

have a form, *enctype="multipart/form-data"*, with one

<select name="XX" multiple="multiple">


which allows the user to select multiple options. When handling the POST
using Apache Commons FileUpload, I detect the *select* field via

// Process a regular form field

if {item.isFormField()) {
    String name = item.getFieldName();

    String value = item.getString();
}

The problem I'm having is that *item.getString();* returns only the first
selected value from the *select* field; no matter how many items I pick, I
only get the first item.

Likewise, when I use the standard servlet method for parameter extraction,
ie.

final String[] values = request.getParameterValues("XX");


values is empty, which I assume is because the form is encoded multipart.

How can I retrieve these multiple selected values from my multi-select
field?





Thanks

Anand Shankar

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message