How do I refer to a file that is in the following directory in Java web app:
webapps/WEB-INF/myfiles/filename
I have read that this has got to do with relative paths, but I do not understand how to do that.
How do I refer to a file that is in the following directory in Java web app:
webapps/WEB-INF/myfiles/filename
I have read that this has got to do with relative paths, but I do not understand how to do that.
If you are writting servlet code and trying access any file/resource inside your web application then you you can use to types of paths.
1.RealPath
2.contextPath
The details of which you can find from this link
http://www.avajava.com/tutorials/lessons/how-do-i-get-the-location-of-my-web-application-context-in-the-file-system.html
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.