Portlet数据对接手册

2024-09-13

Portlet数据对接手册

Portlet数据对接手册 篇1

本文为数据对接格式及Portal对应操作说明

一、柱状图报表

(一)Java端代码如下

/** * 柱状图

* 此类为几个柱状图为一组的情况 * @author wangchs * */ public class CollBarChart2 extends HttpServlet{ String data = “[ { ”登记类别“:”新立“, ”合计“:12, ”能源矿产“:1, ”黑色金属矿产“:4, ”贵金属矿产“:4, ”

+ “"非金属矿产”:3, “有色金属矿产”:1, “稀有、稀散稀土矿产”:1, “水气矿产”:2, “批准登记面积”:2387 },“+

” { “登记类别”:“变更”, “合计”:179, “能源矿产”:5, “黑色金属矿产”:10, “贵金属矿产”:29, “

+ ”“非金属矿产”:14, “有色金属矿产”:6, “稀有、稀散稀土矿产”:3, “水气矿产”:3, “批准登记面积”:14427 }, “+

”{ “登记类别”:“延续”, “合计”:19, “能源矿产”:6, “黑色金属矿产”:4, “有色金属矿产”:15, “

+ ”“贵金属矿产”:15, “稀有、稀散稀土矿产”:2, “非金属矿产”:2, “水气矿产”:5, “批准登记面积”:1215 }, “+

”{ “登记类别”:“其他”, “合计”:471, “能源矿产”:8, “黑色金属矿产”:4, “有色金属矿产”:23, “

+ ”“贵金属矿产”:35, “稀有、稀散稀土矿产”:1, “非金属矿产”:9, “水气矿产”:7, “批准登记面积”:37759 }]“;public void doGet(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

response.setCharacterEncoding(”UTF-8“);

response.setContentType(”text/html;charset=UTF-8“);

response.setHeader(”Pragma“, ”No-cache“);

response.setHeader(”Cache-Control“, ”no-cache“);

response.setDateHeader(”Expires“, 0);

// response.setContentType(”text/html“);

try {

PrintWriter out = response.getWriter();

out.write(data);

out.flush();

out.close();

} catch(IOException e){

e.printStackTrace();

}

}

public void doPost(HttpServletRequest request, HttpServletResponse response)

throws ServletException, IOException {

response.setCharacterEncoding(”UTF-8“);

response.setContentType(”text/html;charset=UTF-8“);

response.setHeader(”Pragma“, ”No-cache“);

response.setHeader(”Cache-Control“, ”no-cache“);

response.setDateHeader(”Expires“, 0);

try {

response.getWriter().write(data);

} catch(IOException e){

}

PrintWriter out = response.getWriter();

out.println(”“);

out.println(”“);

out.println(” A Servlet“);

out.println(” “);

out.print(” This is “);

out.print(this.getClass());

out.println(”, using the POST method“);

out.println(”

上一篇:电脑科技文化艺术节主持人串词下一篇:小学纪律作风整顿活动自查报告