commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Priest <Robert.Pri...@bentley.com>
Subject RE: [FileUpload] Multiple form inputs with same name
Date Mon, 22 Sep 2003 14:16:44 GMT
you may want to try:

// Process a regular form field
if (item.isFormField()) {
    String name = item.getFieldName();
    String value = item.getString();
    ...
}

see: http://jakarta.apache.org/commons/fileupload/using.html

Whether that will return a comma-delimited list for checkboxes I am not
sure, but that is the 
way that you are supposed to get the information out.


A while back, they authors of FileUpload were planning on changing the field
access to mimic what happens is  Java HttpServletRequest. 

So one would be able to use:

getParameter() , and in your case, 
getParameterValues()
(http://java.sun.com/products/servlet/2.3/javadoc/javax/servlet/ServletReque
st.html#getParameterValues(java.lang.String))

but only they can tell you where that effort is at this particular moment.

-----Original Message-----
From: Gredler, Dani [mailto:DaniGredler@integra-soft.com]
Sent: Monday, September 22, 2003 9:59 AM
To: 'commons-user@jakarta.apache.org'
Subject: [FileUpload] Multiple form inputs with same name


Hi,

I have a multipart form with a set of checkboxes, all of which have the same
name, plus some file inputs, all with different names. I'm migrating to Java
on the server side and am trying to use the FileUpload package to process
the requests. The problem is that I was expecting the FileItem.getString()
method to return some kind of list of the values of the checkboxes that had
been checked. Instead, I only have access to the last value checked. Under
our previous platform (MS) the getString() equivalent returned a
comma-delimited list of the values. Can anyone enlighten me?

Thanks in advance,

Dani Gredler

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message