jfreechart图片默认存放路径修正.docVIP

  • 9
  • 0
  • 约4.89千字
  • 约 4页
  • 2017-05-13 发布于北京
  • 举报
jfreechart图片默认存放路径修正

修改JFreeChart 图片的存放路径 JFreeChart会把生成的图片,默认放在应用服务器的temp目录下,有的时候我们是不能放在该目录下的,需要改变这个存放路径 发现jfreechart的ServletUtilities类里有 protected static void createTempDir() { ??????? String tempDirName = System.getProperty(java.io.tmpdir);默认的临时文件 Users\ADMINI~1\AppData\Local\Temp\ ??????? if (tempDirName == null) { ??????????? throw new RuntimeException(应用服务器目录下不存在temp目录或该目录无法创建); ??????? } ??????? // create the temporary directory if it doesnt exist ??????? File tempDir = new File(tempDirName); ??????? if (!tempDir.exists()) { ??????????? tempDir.mkdirs(); ??????? } ??? } 该方法创建了默认的图片存放路径 在该类的saveChartAsPNG(

文档评论(0)

1亿VIP精品文档

相关文档