?? piemonthaction.java
字號(hào):
package demo.action;
import java.io.PrintWriter;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import demo.chart.WebChart;
import demo.chart.WebChartDataset;
public class PieMonthAction extends Action {
private final static String SUCCESS = "success";
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
//設(shè)置輸出編碼格式
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
HttpSession session = request.getSession();
WebChartDataset dataset = new WebChartDataset();
WebChart chart = new WebChart();
chart.setValue(dataset.createPieData());
String filename = chart.generatePieChart3D("月統(tǒng)計(jì)比例圖",
session, out);
String graphURL = request.getContextPath()
+ "/servlet/DisplayChart?filename=" + filename;
request.setAttribute("filename",filename);
request.setAttribute("graphURL",graphURL);
return mapping.findForward(SUCCESS);
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -