I need to retrieve a document which is external to .war file and with in the same server location. I dont want to hard code the file location path in my jsp. Is there any other alternative by using getRealPath() method. Pl let me know how to use application.getRealPath() if it makes any sense.
Hoping to hear from you soon
posted 7 years ago
The ServletContext#getRealPath() just returns an absolute file system path for the given relative webcontent path.
I dont want to hard code the file location path in my jsp.
You should also not write Java code in JSP files. Use Java classes and configuration files.