I need to download multiple files from my jsp,My jsp will receive a string array,and in that each array will have a filePath.I ggot the solution to download multiple files by Using ZipOutPutStream,But i don't want to Zip Them,I need to download them in a folder.In that folder i should have all the files.
Apart from the bad taste involved in using a JSP to do a file download, the fact is that an HTTP response cannot contain more than one file unless those files are wrapped in some suitable wrapper. A Zip archive is a suitable wrapper. A "folder" -- well, there's no such MIME type. What's your reason for not wanting to use a Zip archive?
Expanding on on Paul's explanation, HTTP is a 1-to-1 request/response protocol. You send 1 request, which is a URL GET, POST, or whatever, and the server returns 1 response, which can be a "file", a web page, or whatever.
You cannot return multiple responses from a single request, and you DEFINITELY cannot have your server select a directory on the client computer's disk drive and write a file into it. A file download is just an HTTP response data stream that has certain characteristics designed to alert the client to the need to save the response contents as a file instead of doing something like displaying it as a web page. The client will then display a dialog asking the user what directory that response should be written into as a file.
There is a reason for the dialog. It ensures that malicious servers cannot insert or replace critical system files with viruses. And it means that the server doesn't have to know anything about the client's filesystem or filesystem organization. I'm using a Linux machine, and there is no such thing as a "C" drive on Linux, any more than there is in IBM's z/OS. The web isn't a file server, after all.
You could automate the process of multiple file downloads by adding AJAX logic to the page that does the download request so that within that page, a succession of AJAX http request/response cycles are initiated, one for each file. But even then, the user will be prompted for the download directory on each file, due to the security constraints I mentioned earlier, commonly known as the "sandbox". A digitally-signed client-side logic module can avoid that, but that's not something you want to do lightly. It's usually very confusing and messy to get a client to accept a signed logic module. Microsoft ActiveVirus[TM] excepted.
Bjoke: A "Bully Joke". A Statement or action made with malicious intent - unless challenged. At which point it magically transforms into "I was just funnin'" or "What's the matter, can't take a joke?"