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] - Model FileUpload model to mimic javax.servlet.Request
Date Wed, 11 Jun 2003 10:08:23 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





------- Additional Comments From Aristarkhov@bitechnology.ru  2003-06-11 10:08 -------
Will, I see one potential problem in your implementation. FileItems and request 
parameters are separated, so when we call getParameter("upfile"), 
where "upfile" is a FileItem the result of this call will be null. IMHO such 
behaviour breakes common semantic of getParamter() and getParameterValues(). 
Onother issue of your implementation that getParameterNames() returns only 
names of !FileItem paramters. 
I can suggest some solution for this. Actually in a request wrapper class we 
need to override implementation of getParameter() and getParamterValues(). NO 
difference should be made what kind of parameters we have - FileItem or usual 
parameter - getParamter() should return a value. 
But in case of FileItem parameter the value could be a name of uploaded file 
(say, in format - "Uploaded file: <filename>") or just a string (say "binary"). 
Also FileItem parameter's names should be included in the result of 
getParameterNames(). What we need to do this - some super class that can 
represent both - FileItem and usual parameters.
To demonstrate my thouhgts (already implemented) I'll post 4 attachments 
followed by my comments. Attachments include:
AbstractMultipartParameter.java - a super class that represents binary and 
usual parameters

TransientParameter.java - concrete implementation of AbstractMultipartParameter 
that holds data in memory

AbstractMultipartRequest.java - abstract implementation of request wrapper 
(I've skipped implementation of parsing methods for convinience)

TransientRequest.java - concrete implementation of request wrapper that holds 
data in memory (coupled with TransientParameter).


UploadServlet.java - sample servlet that uses 
TransientRequest/TransientParameter classes for request processing.

Another feature of classes mentioned above is a plug-in architecture of 
multipart request processing - there is an abstract implementation with base 
logic of request processing and custom classes for customization.

---------------------------------------------------------------------
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