资源简介
源码支持环境:Apache+Mysql+PHP
初始登录:杜明----1121
代码片段和文件信息
package com.highcharts.export.controller;
import java.io.BufferedReader;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.StringReader;
import java.util.Enumeration;
import javax.servlet.ServletException;
import javax.servlet.ServletOutputStream;
import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.Part;
import org.apache.batik.transcoder.SVGAbstractTranscoder;
import org.apache.batik.transcoder.TranscoderException;
import org.apache.batik.transcoder.TranscoderInput;
import org.apache.batik.transcoder.TranscoderOutput;
import org.apache.batik.transcoder.image.JPEGTranscoder;
import org.apache.batik.transcoder.image.PNGTranscoder;
import org.apache.fop.svg.PDFTranscoder;
import org.apache.log4j.Logger;
import com.highcharts.export.util.MimeType;
/**
* Servlet implementation class BatikExport
*/
@WebServlet(name = “Highcharts-Export“ urlPatterns = { “/*“ })
@MultipartConfig
public class ExportController extends HttpServlet {
private static final long serialVersionUID = 1L;
private static final String REQUEST_METHOD_POST = “POST“;
private static final String CONTENT_TYPE_MULTIPART = “multipart/“;
protected static Logger logger = Logger.getLogger(“exportservlet“);
/**
* @see HttpServlet#HttpServlet()
*/
public ExportController() {
super();
// TODO Auto-generated constructor stub
}
/**
* @see HttpServlet#doGet(HttpServletRequest request HttpServletResponse
* response)
*/
protected void doGet(HttpServletRequest request
HttpServletResponse response) throws ServletException IOException {
processrequest(request response);
}
/**
* @see HttpServlet#doPost(HttpServletRequest request HttpServletResponse
* response)
*/
protected void doPost(HttpServletRequest request
HttpServletResponse response) throws ServletException IOException {
processrequest(request response);
}
public void processrequest(HttpServletRequest request
HttpServletResponse response) throws IOException ServletException {
try {
boolean multi = isMultipartRequest(request);
String svg = getParameter(request “svg“ multi);
if (svg == null || svg.isEmpty()) {
throw new ServletException(
“The required - svg - post parameter is missing“);
}
String filename = getFilename(getParameter(request “filename“
multi));
Float width = getWidth(getParameter(request “width“ multi));
MimeType mime = getMime(getParameter(request “type“ multi));
ExportController.writeFileContentToHttpResponse(svg filename
width mime response);
} catch (IOException | ServletException sce) {
logger.error(“Oops something happened here redirect to error-page “ + sce.getMessage());
sendError(reque
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 3542 2012-11-25 00:00 examples\area-basic\index.htm
文件 2478 2012-11-25 00:00 examples\area-inverted\index.htm
文件 2427 2012-11-25 00:00 examples\area-missing\index.htm
文件 1497 2012-11-25 00:00 examples\area-negative\index.htm
文件 2580 2012-11-25 00:00 examples\area-stacked\index.htm
文件 2506 2012-11-25 00:00 examples\area-stacked-percent\index.htm
文件 1394 2013-10-18 16:58 examples\arearange\index.htm
文件 2347 2012-11-25 00:00 examples\areaspline\index.htm
文件 2485 2012-11-25 00:00 examples\bar-basic\index.htm
文件 2894 2012-11-25 00:00 examples\bar-negative-stack\index.htm
文件 1806 2012-11-25 00:00 examples\bar-stacked\index.htm
文件 2750 2012-11-25 00:00 examples\column-basic\index.htm
文件 5542 2012-11-25 00:00 examples\column-drilldown\index.htm
文件 1501 2012-11-25 00:00 examples\column-negative\index.htm
文件 3249 2012-11-25 00:00 examples\column-parsed\index.htm
文件 3125 2012-11-25 00:00 examples\column-rotated-labels\index.htm
文件 2643 2012-11-25 00:00 examples\column-stacked\index.htm
文件 2084 2012-11-25 00:00 examples\column-stacked-and-grouped\index.htm
文件 1738 2012-11-25 00:00 examples\column-stacked-percent\index.htm
文件 1767 2012-11-25 00:00 examples\columnrange\index.htm
文件 3039 2012-11-25 00:00 examples\combo\index.htm
文件 3102 2012-11-25 00:00 examples\combo-dual-axes\index.htm
文件 4218 2012-11-25 00:00 examples\combo-multi-axes\index.htm
文件 1591 2012-11-25 00:00 examples\combo-regression\index.htm
文件 2522 2012-11-25 00:00 examples\dynamic-click-to-add\index.htm
文件 18507 2012-11-25 00:00 examples\dynamic-master-detail\index.htm
文件 2886 2012-11-25 00:00 examples\dynamic-update\index.htm
文件 4297 2012-11-25 00:00 examples\gauge-clock\index.htm
文件 2957 2012-11-25 00:00 examples\gauge-dual\index.htm
文件 3205 2012-11-25 00:00 examples\gauge-speedometer\index.htm
............此处省略124个文件信息
- 上一篇:微信上墙PHP源码
- 下一篇:一卡通管理系统文档+源代码PHP和MYSQL
评论
共有 条评论