Hi Dhanya,
This snippet might help with FileUpload:
1. Check if the request is multipart (which it has to be if you are
passing around files)
DiskFileItemFactory factory = new
org.apache.commons.fileupload.disk.DiskFileItemFactory();
factory.setRepository(new File(your_temp_folder));
ServletFileUpload upload = new ServletFileUpload(factory);
boolean isMultipart = upload.isMultipartContent(request);
2. Get the list of items
List<FileItem> items = upload.parseRequest(request);
3. Iterate through this list, and get the FileItems.
4. Check for the flag isFormField() on every FileItem you get - if
true, it is one of the form fields (text, etc) and if false, it is a
file. Put the stuff in your beans or DTOs accordingly. Check the
FormField API for more info on getting values/names etc.
Hope this helps!
-cheers,
Manish