I am trying to upload an image from the jsp page. I want to store the same image with three names. For the first time the image is stored but it gives a NullPointer Exception at FileItem write method second time in the loop.
Please help.....
Code is
There is a NullPointerException at line 13 second time in the loop
To be a winner first you need to be a begineer.
Raina Rajat
SCWCD (95%)
SCJP(70%)
Edit: your code at its own makes less sense. You're doing it three times for all the files. Once the stream is already read, you can't read it again. Remove that for-loop and that session getting/setting. Just keep it simple and follow the user guide at commons fileupload homepage. Once you're finished with that all, you're free to duplicate the files using the usual java.io stuff.
Thanks Bauke
It worked the way you told but I still have a doubt. The request stored in the List can be saved as an attribute of session so that the List can be used mutiple times.I am a bit confused on this. That is way i have used that that session getting/setting.
To be a winner first you need to be a begineer.
Raina Rajat
SCWCD (95%)
SCJP(70%)