how I can read a file in servlet which is outside of servlet container ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In my job i have used the
system propertyvalues to read the properties file outside the servlet container or WEB-INF folder or outside application context.If you are using JBOSS server then use the
or for Tomcat
Along with the above code , use the
System.getProperty("file.separator");This way you can read the updated changes from the file and prevent redeployement of war or jar file and works in all platforms(windows,unix).
if you are running a standalone application, u can supply your own property like below
during application launch