you can get specific current path of execution inside the java runtime and then go from there. Knowing a standard WAR or EAR structure will help Check this one
Get the location of my web application context
Go through the directory structure in this Directory Structure of EAR/WAR/JAR
Problem is not modifying but rather loading the modified path/file. There is a term called Hot Deployment. You are making that even Hotter LOL !!. Whenever you change a specific file the Application server needs to reload the specific WAR or EAR (in case the files changed are class files or java files). generally JSP and HTML file changes made while the application is running becomes available at the time of reload.
If the specific file is inside a JAR you may have to recompile the jar and redeploy/reload it into your application. This may help Loading jar at runtime/dynamically