Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: Java Servlets
Expertise: Beginner
Oct 10, 2000



Building the Right Environment to Support AI, Machine Learning and Deep Learning

Servlet Resources

Where is the best place to store .property files and .xml files for servlets/jsp? Right now I am using "user.home", but there is a problem when you have multiple web application because you may store only one set of files.

You have several choices. You could use resource bundles, store the files in the classpath and use Class.getResource() to retrieve it, use servlet init parameters to tell the servlet the location of the resources, or define system properties.

Resource bundles are the most general mechanism and allow for internationalization. Servlet init parameters allow the greatest flexibility in that you can pass any arbitrary location to the servlet. Storing files in the classpath makes for rather awkward applicaiton deployments as does defining system properties. Ultimately, the exact nature of your application will dictate the most appropriate way to go.

DevX Pro
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date