Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how do i use a static data file in a web app

Status
Not open for further replies.

taylorj

Programmer
Oct 21, 2003
14
IE
Hi there,
I am writing a web application that I deploy as a war but would like to put in functionality in a servlet to read and write to a text file. I am able to do this easy from a stand alone java app but am not sure where to put these text files in the war?? Or how to read from them, like where will the servlet look for them??
At present I have them in WEB-INF/classes and the servlet does not work. The files just store users names on the server, like a register. I am using the servlets init method to read the file and store the list of registered users in a class variable. The servlets destroy method then writes to the file if the user is a new user. I know this might not be the best way but its part of the specification.
Regards,
James.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top