熱點推薦:
您现在的位置: 電腦知識網 >> 編程 >> Java編程 >> Java核心技術 >> 正文

JSP引入JFreeChart

2013-11-23 18:41:50  來源: Java核心技術 
    JFreeChart chart = JFreeChartToolToLineChart(list)
    try {
    HttpSession session = ServletActionContextgetRequest()
    getSession()
    String filename = ServletUtilitiessaveChartAsPNG(chart
    null session)
    Systemoutprintln(filename)
    String graphURL = requestgetContextPath()
    + /servlet/DisplayChart?filename= + filename;
    requestsetAttribute(graphURL graphURL)
    } catch (IOException e) {
    eprintStackTrace()
    }
    頁面中加入
    <img src=;%= requestgetAttribute(graphURL) %>>


From:http://tw.wingwit.com/Article/program/Java/hx/201311/25595.html
    推薦文章
    Copyright © 2005-2013 電腦知識網 Computer Knowledge   All rights reserved.