commons-user  

[FileUpload] Does ServletFileUpload have to be an instance variable?

Jamie Bisotti
Thu, 19 Jul 2007 11:48:14 -0700

I've looked at the examples, and it looks like they are all creating the
following instance variables inside the Servlet's doPost(...):


...
// Create a new file upload handler
ServletFileUpload upload = new ServletFileUpload( new DiskFileItemFactory() );
...


Do they have to be created on each request (i.e. be instance variables)?
Or, could I have 'private static final' members that get reused?

Thank in advance.

--
Jamie Bisotti
  • [FileUpload] Does ServletFileUpload have to be an instance variable? Jamie Bisotti