⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 showbusinessyearaction.java

📁 上网计费系统,适用网吧或者自己学习用用JAVA写成
💻 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-13-2007
 * 
 * XDoclet definition:
 * 
 * @struts.action
 * @struts.action-forward name="failed" path="/admin/business/lex_year.html"
 * @struts.action-forward name="success" path="/admin/business/lex_year.html"
 */
public class ShowBusinessYearAction 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 byears = null;
		try {
			IService iService = BeanFactory.getService();
			byears = iService.showBusinessYear();
		} 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_year.JPG");
		try {
			FileOutputStream fos = new FileOutputStream(path);
			pieChart.createChart(fos, byears, "各品牌营收情况", 500, 300,
					"Businessyear");
		} catch (IOException e) {
			e.printStackTrace();
		}
		request.setAttribute("byears", byears);
		return mapping.findForward("success");
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -