1 Reply Latest reply on Apr 26, 2007 10:37 AM by Andrei Munteanu

    directories and files write and read

    Andrei Munteanu Newbie

      I am developping with ejbca and Jasperreports. I nead a temporary folder where i can generate some images and html files and then relod them to the user on the screen.

      I have tried various paths with no rules. I already checked all the files are well deployed by JBoss inside a directory like this:

      /opt/jboss/server/default/tmp/deploy/tmp38980ejbca.ear-contents/adminweb-exp.war/

      inside there is a WEB-INF directory

      I would like to put my files into WEB-INF/reports/ or something at runtime.

      This is my code for reading a file:

      jasperReport = JasperCompileManager.compileReport("/opt/ejbca_CVS/ejbca_ECLIPSE/src/adminweb/WEB-INF/reports/charts.jrxml");

      it works only with a complete path to a stable directory for now.

      This is supposed to generate a html file and all the images:

      JasperExportManager.exportReportToHtmlFile(jasperPrint,"../WEB-INF/reports/charts.html");

      This one uses relative paths. I have errors on this one like this:

      net.sf.jasperreports.engine.JRException: Error creating to file writer : charts


      The file from where i am running this is located at:

      /ejbca/adminweb/log/viewcharts.jsp

      the .. should put me to /ejbca/adminweb/


      Well, it does not work!

      Does anyone know how to obtain a good directory and most of all how to configure JBoss in order to have write aces to that directory?


      Thanks.




        • 1. Re: directories and files write and read
          Andrei Munteanu Newbie


          I managed to obtain the path and to write my files using ((HttpServletRequest)rqs).getSession().getId() and hs.getServletContext().getRealPath("/reports/");

          My web page gets generated inside "/reports/" but i cannot see the images.

          I am using an ssl secured connection and it seems JBoss won't let me see the images belonging to the file.

          Te page itself is included from the JSP....

          Any help would be apreciated. Does JBoss has some security settings restrictig pages that internet users can read?