View Single Post
Old 03-28-2006, 01:04 PM   #6 (permalink)
Belisarius
Java fanboy
 
Belisarius's Avatar
 
Join Date: Aug 2003
Posts: 1,152
Belisarius is on a distinguished road
I'm honestly not familiar enough with log4j to know how to customize logfile creation, sorry.

As for sending the user a file, the best way to do it is using ServletResponse (it's an implicit variable available to JSPs, the "response" variable).

What you do is you send the client a MIME type, letting them know what kind of file it is, and then stream the data to them. This is secure because you're controlling access to the stream (based on a users session, I assume). You also don't need to take up diskspace, as you can generate the reports on the fly. However, the tradeoff is in CPU and memory utilization, so you might want to store them locally and then stream the files (as opposed to offer them up for download).

Quote:
Originally Posted by j.gohel
And what about creating different log4j file whenever my application starts newly everytime???

Also i am generating some report files through my application & this application would be used by many users across web..

So each individual user who would be using the application should be able to get that generated reports or rather generate in the file system of their own PC.Currently my files are getting generated on the fileSystem where i m developing & testing my application, ie on server's file system...So how can i make it possible to generate the files on user's local PC & not on server??

If its very difficult then suggest some alternatives regarding the same....

Thanks,
Jignesh
__________________
GitS
Belisarius is offline   Reply With Quote