How to search a file in a file server and serve from servlets?
Joined: Dec 17, 2008
i have a requirement like this, i had successfully generated a scheduler which generates the pdf reports periodically and put it into a file server. Now these files are the one to be served to the client through the servlets. the user searches for a report, if found in the db displays the info about the report in a table grid. user selects the reports and clicks print. now i need to find this report in the file system, if found read it and write to the client. How do i search in the file server for a file from the servlet, and also effectively?
How do i do it? which design pattern may i use to implement this search? suggested oo way? may i use cache?
thanks for replying, Bibeault. there will be a jsp page which will allow the user to key-in the report name. grid in the jsp will display the details of the report stored from the database. the user selects an item in the grid and press print. The details of the report requested to be printed will be sent to the struts action. That action will fwd to me, with all the information like which class does it belong, im thinking of keeping an xml file which has the configuration of which class of files stored where. with this information in hand my module should find the file read it and write to the client. sometimes i may need to join more than one report together and send it, (this is not the problem now). the thing is i wish to implement it as a small framework or according to the OO pattern