If it is placed in the webapp's classpath, then just use:
If it is placed in the global classpath, then use:
If it is placed in the webcontent, then just use:
The examples assumes that they're placed in the root. You can of course use relative path as opposed to the classpath root or webcontent root, e.g. path/to/file.txt
. You can get the ServletContext
in Struts by ServletActionContext#getServletContext()
.