2 Replies Latest reply on Nov 14, 2012 10:33 AM by gimbal2

    Reading XML from default location

      let say I have an XML file from default location. and, I want my servlet to read it everytime comes alive. does a servlet have a special api to do this? Or, I just do what I normally do in a java application in reading xml files?
        • 1. Re: Reading XML from default location
          I didn't know there was a default location!

          If the XML is only to be read by the Servlet then add the file to the Serlet jar file and access it as a jar resource.
          • 2. Re: Reading XML from default location
            There is no such thing as a world-spanning default location. But many technologies/products do provide specific locations where you can put stuff. For example JBoss allows you to read configuration files from the server instance's conf directory through the 'jboss.server.config.url' system property. But yeah - thats a default location for a JBoss environment. Not for Tomcat, not for Glassfish, not for Weblogic, etc.

            The manual of whatever specific product being used should give hints as to what is possible.

            Of course the jar resource is also a viable answer, if the configuration file is not environment (dev/test/uat/prod) specific.