struts+jfreechart,路径问题 为什么生成图片后,在C:\Users\Jason\AppData\Local\Temp这个文件夹中。 前台JSP中怎么取?在线等。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 生成jfreechart 图片应该是在你的服务器上,为什么会出现在操作系统路径里面? 在生成的时候,会有一个图片路径需要设置的。JFreeChart chart = null; if ("pie".equals(showmode)) { // 绘制饼型图 chart = getChartForPie(type, sql, request); } else { // 绘制柱型图 chart = getChartForBar(type, sql, request); } if (chart != null) { chart.getPlot().setDrawingSupplier(new CustomDrawingSupplier()); myplot(showmode, chart); // 设置各标签的显示样式 String webName = request.getRealPath("\\publicInfo\\img"); String picpath = ""; String mappath = ""; if ("dept".equals(type)) {// 图片路径 picpath = webName + "/" + showmode + type + ".jpg"; mappath = webName + "/" + showmode + type + ".map"; } else if ("date".equals(type)) {// 图片文件路径 picpath = webName + "/" + showmode + type + i + j + ".jpg"; mappath = webName + "/" + showmode + type + i + j + ".map"; } // 热区文件路径 FileOutputStream plot_fos = new FileOutputStream(picpath); PrintWriter map_pw = new PrintWriter(mappath); ChartRenderingInfo info = new ChartRenderingInfo( new StandardEntityCollection()); // 生成图片文件 ChartUtilities.writeChartAsJPEG(plot_fos, 0.8f, chart, width, height, info); // 生成热区文件 ChartUtilities.writeImageMap(map_pw, "mymap", info, false); plot_fos.close(); map_pw.close(); request.setAttribute("path", webName); } 新人求教java前后台验证码如何比较 急 js验证图片尺寸 高分求详细答案TOMCAT与IS的配置 请教 为什么我做的jsp程序只显示一半剩下的就没了。。。郁闷。。。 hibernate的事务管理 怎么实现下拉列表的动态连接? 怎样判断字符串为null??? 有没有这样的开发模式,jsp+com,讨论一下吧 新手向大家请教jsp,servlet的调试,发布问题 Caused by: org.hibernate.MappingException: Unknown entity: com.topwalk.oa.person Struts2前台jsp向后台传递参数的问题
JFreeChart chart = null;
if ("pie".equals(showmode)) {
// 绘制饼型图
chart = getChartForPie(type, sql, request);
} else {
// 绘制柱型图
chart = getChartForBar(type, sql, request);
}
if (chart != null) {
chart.getPlot().setDrawingSupplier(new CustomDrawingSupplier());
myplot(showmode, chart); // 设置各标签的显示样式
String webName = request.getRealPath("\\publicInfo\\img");
String picpath = "";
String mappath = ""; if ("dept".equals(type)) {// 图片路径
picpath = webName + "/" + showmode + type + ".jpg";
mappath = webName + "/" + showmode + type + ".map";
} else if ("date".equals(type)) {// 图片文件路径
picpath = webName + "/" + showmode + type + i + j + ".jpg";
mappath = webName + "/" + showmode + type + i + j + ".map";
} // 热区文件路径
FileOutputStream plot_fos = new FileOutputStream(picpath);
PrintWriter map_pw = new PrintWriter(mappath);
ChartRenderingInfo info = new ChartRenderingInfo(
new StandardEntityCollection());
// 生成图片文件
ChartUtilities.writeChartAsJPEG(plot_fos, 0.8f, chart, width,
height, info);
// 生成热区文件
ChartUtilities.writeImageMap(map_pw, "mymap", info, false);
plot_fos.close();
map_pw.close();
request.setAttribute("path", webName);
}