2 Replies Latest reply: Sep 4, 2012 8:50 AM by jtahlborn RSS

    XML Creation Using Jdevloper

    Ajay Sharma
      Hi Gurus.

      I m developing a web service using Jdevloper. In this I am creating one xml file.

      problem is I want to store this xml file under my web service package. but Its gettingcreated to another location

      here is my file creation code

      File file = new File("./generic-config.xml");

      this file is creating under " C:\OAFramework\jdevbin\j2ee\home "


      What is the reason behind this ? and how to store it inside my web service folder

      my web service folder is " C:\OAFramework\jdevhome\jdev\mywork\GenericWebservices\GenericWebservice "

      Regards,
      Ajay
        • 1. Re: XML Creation Using Jdevloper
          Ajay Sharma
          Hello Gurus..


          Does any one know about it..

          Please reply...



          Regrds,
          Ajay
          • 2. Re: XML Creation Using Jdevloper
            jtahlborn
            File file = new File("./generic-config.xml");
            This line creates a file relative to the "working directory" of the JVM. the JVM you are running in must therefore have the working directory "C:\OAFramework\jdevbin\j2ee\home". if you are running within a Servlet container, you may be able to use http://docs.oracle.com/javaee/5/api/javax/servlet/ServletContext.html#getRealPath%28java.lang.String%29 to get the path to your servlet directory. otherwise, i don't know a way of getting that path from within the jvm.