> Hi,
>
> I'm wondering if the DiskFileUpload.parseRequest method
> is thread-safe.

No. It is not thread safe. It delegates it to the super class FileUploadBase
which uses the sizeMax variable, access to which is not synchronized.

I'm planning on using it along these
> lines, and would like to know if it would work:
>
>     private static DiskFileUpload parser = null;
>
>     public doPost(HttpServletRequest request,
>                   HttpServletResponse response) {
>
>         if (parser == null) {
>             ...initialize on first call...
>         }
>         try {
>             list = parser.parseRequest(request);
>             ...
>         } catch (FileUploadException e) {
>             ...
>         }
>     }
>
> Basically I'd like to have a single instance of
> DiskFileUpload, in order to save me from some
> repetitive object creation and configuration.

Probably the best bet is to keep in the ServletContext.

Also,
> what would happen if the setX() methods were to be
> called while parsing a request? (I guess it would be
> better to create a new object in that case, but I'm
> curious.)
>

What do you mean by while parsing a request?

>
> /Per

Vikram


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to