commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 20523] New: - Model FileUpload model to mimic javax.servlet.Request
Date Thu, 05 Jun 2003 21:01:20 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20523>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=20523

Model FileUpload model to mimic javax.servlet.Request

           Summary: Model FileUpload model to mimic javax.servlet.Request
           Product: Commons
           Version: 1.0 Final
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: File Upload
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: wstranathan@hotmail.com


Request to make the API more consistent with the getParameter(String name) and 
getParameterValues(String name) models of javax.servlet.Request.

1) For FileUpload to have getParemeter(String name) or getParameterValues
(String name) - should implemented on top of the current API so that there are 
no backward-compatibility issues. 
2) At LEAST working out a kink where multi-valued parameters actually appear as 
separate FileItems with the same value returned by getFieldName(). 

Example of new model: 

DiskFileUpload upload = new DiskFileUpload(); 
// Now, rather than applying an Iterator to parseRequest, 
// call the same method, but pull the individual items from the 
// DiskFileUpload object itself 
upload.parseRequest(request); 
FileItem myfile = (FileItem)upload.getParameter("myfile"); 
// And this looks ALMOST like ServletRequest.getParameter(String name) 
String lastname = (String)upload.getParameter("lastname"); 
String[] favoriteColours = upload.getParameterValues("favoritecolours"); 

Alternately, a getFileItem(String name) method could be added in order to 
shield the user from having to cast the result of getParameter(String name) to 
a FileItem - and this same method could wrap ordinary field values in FileItems 
similarly to the way they are returned in the Iterator.

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


Mime
View raw message