2 Replies Latest reply on Nov 2, 2005 11:22 AM by P V

    Path to Server Root

    P V Newbie

      Hi,

      I have put a war in default/deploy in wich I hava a class that reads a xml file.

       Document doc = parseXmlFile("infilename.xml", false);
      


      where should I put the xml? What's the root of the server?

      thanks

        • 1. Re: Path to Server Root
          Utah Jazz Newbie

          You could create an emtpy file:

          try{
          File nf = new File("infilename.xml");
          FileWriter fw = new FileWriter(nf);

          fw.write("where am i");
          fw.close();
          System.out.println("done");
          }catch(Exception e){
          System.out.println(e);
          }

          and then go search for it to see where it got written to. Just an idea.

          • 2. Re: Path to Server Root
            P V Newbie

             

            "utjazz" wrote:
            You could create an emtpy file:

            try{
            File nf = new File("infilename.xml");
            FileWriter fw = new FileWriter(nf);

            fw.write("where am i");
            fw.close();
            System.out.println("done");
            }catch(Exception e){
            System.out.println(e);
            }

            and then go search for it to see where it got written to. Just an idea.


            That's a very good solution.

            thanks, Pedro