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.
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.