I am not sure if this is the correct forum, and I am very new to JSF so please bear with me.
I have a JSP page where a user can enter information which will then be written to a text file.
I have a class that has a method to write to the text file.
My problem ( I think ) is that I am not getting the right location of the text file and the path to it.
Here is the code of my class
You are attempting to write data into your WAR, using a relative path.
1. You should not attempt to use a relative path in J2EE apps. The current directory that the path is relative to is unpredictable and can be changed without notice.
2. You should NEVER attempt to write anything into a WAR or into any of the directories that your webserver live in. The WAR should be treated as read-only (sometimes it is), and even if you can write to it, any data written there may not stay written there.
It is better to select a directory that is external to your webserver and write your files into it.
An IDE is no substitute for an Intelligent Developer.