Wesley Wu wrote:
> Hi Scott,
>
> I found a frustrating problem when porting my framework to accommodate 
> the Servlet 3.0 file upload spec in Resin 4.0.8/4.0.9. <http://4.0.9.>
Thanks,

I've added this as http://bugs.caucho.com/view.php?id=4153

We're going through and double-checking the spec on this.

-- Scott
>
> There did has a (private Object _value) in 
> com.caucho.server.http.HttpServletRequestImpl.PartImpl, however,
> if it's not a file upload but a common text form field, I could 
> nowhere to retreive the text value
> of the part throught current implementation.
>
> I don't want to write the text value to a file and read it into a 
> string. It's just stupid.
>
> I know it's probably a spec issue without an
>
> Object getValue();
>
> or
>
> String getTextValue();
>
> , but it does has a workaround.
>
> I think the getInputStream() should not return null when the Part is a 
> normal form field. 
> It may return a StringReader or something to let me get the string 
> value throught the InputStream.
>
> maybe like this 
> (from http://balusc.blogspot.com/2009/12/uploading-files-in-servlet-30.html)
>
> /** 
>   * Returns the text value of the given part. 
>   */
> private String getValue(Part part) throws IOException {
>     String value = new BufferedReader(new 
> InputStreamReader(part.getInputStream(), encoding)).readLine(); 
>     return (value != null) ? value : ""; // Must be empty String 
> according HTTP spec.
> }
>
> Now I have to use 
>
> request.getParameterValues(part.getName());
>
> to retrieve the text form field value. But I know it must be wrong, 
> because we may have multiple fields have the same name.
>
> -Wesley
> ------------------------------------------------------------------------
>
> _______________________________________________
> resin-interest mailing list
> resin-interest@caucho.com
> http://maillist.caucho.com/mailman/listinfo/resin-interest
>   



_______________________________________________
resin-interest mailing list
resin-interest@caucho.com
http://maillist.caucho.com/mailman/listinfo/resin-interest

Reply via email to