📄 showbusinessmonthaction.java
字号:
/*
* Generated by MyEclipse Struts
* Template path: templates/java/JavaClass.vtl
*/
package com.briup.web.action;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
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 com.briup.chart.PieChart;
import com.briup.service.IService;
import com.briup.util.BeanFactory;
/**
* MyEclipse Struts Creation date: 03-12-2007
*
* XDoclet definition:
*
* @struts.action
* @struts.action-forward name="success" path="/admin/business/nas_month.html"
*/
public class ShowBusinessMonthAction extends Action {
/*
* Generated Methods
*/
/**
* Method execute
*
* @param mapping
* @param form
* @param request
* @param response
* @return ActionForward
*/
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
List bmonths = null;
try {
IService iService = BeanFactory.getService();
bmonths = iService.showBusinessMonth();
} catch (Exception e) {
e.printStackTrace();
request.setAttribute("message", e.getMessage());
return mapping.findForward("failed");
}
PieChart pieChart = new PieChart();
String path = request.getSession().getServletContext().getRealPath(
"/imgs/chart/lex_month.JPG");
try {
FileOutputStream fos = new FileOutputStream(path);
pieChart.createChart(fos, bmonths, "各品牌营收情况", 500, 300,
"Businessmonth");
} catch (IOException e) {
e.printStackTrace();
}
request.setAttribute("bmonths", bmonths);
return mapping.findForward("success");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -