1 Reply Latest reply on Aug 10, 2004 3:44 PM by zuvirandu

    Loading an imagem from a war file

    zuvirandu

      Hi all!

      I need to render an image to put in a report and the image is in the war file.

      The structure:
      app.ear
      ----> web.war
      -----> /img/image.gif

      How can I know the path to access the file?

      Greeting,
      Zuvirandu

        • 1. Re: Loading an imagem from a war file
          zuvirandu

          Hi, all...

          I did it!

          In a servlet I put:

           public void init() throws ServletException {
           String path = null;
           path = this.getServletContext().getRealPath("/image/");
           Tools.IMAGEM_URL = "file:/" + path + "/";
           super.init();
           }
          


          Thanks!