1 Reply Latest reply on Nov 19, 2002 9:19 AM by roberto

    How to read an xml file in WEB-INF ?

    tsdconcept

      Hi,
      In my servlet init method, I tried to open a file with that method :
      getServletContext().getResource("/WEB-INF/UrlMappings.xml"). It doesn't work since the jndi protocol doesn't exist in JBOSS.
      How can I read a file (such as an xml file) in the WEB-INF folder ?

      Thanks a lot, I am stuck where I wasn't meant to !

      Tsd

        • 1. Re: How to read an xml file in WEB-INF ?

          i just do it using: (in init method)

          getServletConfig().getServletContext().getResourceAsStream("/WEB-INF/MyXml.xml");

          this works for me using JBOSS 3.x WebLogic 6.x / 7.x and WebSphere 4.x

          I use getResourceAsStream .. but i think getResource works too.

          Bye