Well, if u want to download a document to the client machine u have to use multipart mime type. It takes a long time to explain all about that. The best thing you can do is go to
http://www.servlets.com and from there just download com.oreilly.servlet package and in that package you can find MultipartResponse class. Just go through that class and check it out.
You can use this class with out knowing much about it, but as a developer i think it would be nice to go through the class and understand the functionality.
I hope this info will be useful to you.
Lok.