Originally posted by Ad Rajesh: .. it is not working.
That doesn't give us much to work with. What is it doing? Are you seeing an error message in the browser? Have you checked the server's logs to see if there is an exception being thrown? If so, what is it?
Java will try to write your file to the current working directory if you don't specify a full path.
The current working directory, in the case of a webserver, is the directory where the user who started the container was when the container was started; not the directory where your JSP lives. You, the application developer, have no guarantee as to where that directory is going to be AND, even if you do know where it is, will probably not have read/write permissions to it.
You should figure out exactly where you want to write these files, make sure you have sufficent permissions to do so, and then use an absolute path and filename when attempting to read and write your files.