I have a dynamic web project. I need to place a text file inside this project and write information there. The only problem is exactly where the dynamic web project needs to create the file, and what path to this file should be. That is, not to specify the full path to the file, for example "C: / project / file.txt", but place the file inside the project and specify a short path that will work if you move the entire project to another location.
|
1 answer
You can use the relative path of your project by defining it through the class loader. Example
|