import java.sql.*; import java.lang.*; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class LineConfigServlet extends HttpServlet { // // This simple servlet is designed to demonstrate how a servlet can be used // to return configuration information to either the graphing applet or servlet. // As you will see the main routine ( doGet() ) uses the method // GraphData() to construct the return data. // Although in this example the GraphData() rountine simply builds the return // data from 'hard coded' values, in practice this rountine would be expanded // to first gather data from any number of datasources. // eg. databases, files other server processes. // // For further information visit, // http://www.jpowered.com/line_graph/index.htm // //----------------------------------------------------------------------------- public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { res.setContentType("text/html"); ServletOutputStream out = res.getOutputStream(); // Return the Data out.println(ConfigData()); } // End doGet //----------------------------------------------------------------------------- public void doPost(HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException {doGet(request, response);} //----------------------------------------------------------------------------- public static String ConfigData() { String rsltStr = " \n"+ "BackgroundColor: #FFFFFF \n"+ "linkcursor: hand \n"+ "thousandseparator: , \n"+ "nSeries: 3 \n"+ "ndecplaces: 2 \n"+ " \n"+ "grid: true \n"+ "axis: true \n"+ "nRows: 8 \n"+ "vSpace: 20 \n"+ "hSpace: 20 \n"+ "nPoints: 12 \n"+ "gridxpos: 30 \n"+ "gridypos: 270 \n"+ "gridstyle: 2 \n"+ "gridColor: #AAAAAA \n"+ "axisColor: #888888 \n"+ "floorColor: #EEEEFF \n"+ "gridbgimage: \n"+ "gridbgcolor: #FFFF88 \n"+ " \n"+ "autoscale: true \n"+ "chartScale: 1 \n"+ "chartStartY: 0 \n"+ " \n"+ "3D: false \n"+ "outline: false \n"+ "lineOutlineColor: blue \n"+ "depth3D: 0 \n"+ " \n"+ "legend: true \n"+ "LegendBackground: #9999FF \n"+ "LegendBorder: #5555AA \n"+ "LegendtextColor: #FFFFFF \n"+ "legendtitle: Legend Title \n"+ "legendposition: -1,-1 \n"+ "legendfont: Arial,N,12 \n"+ "LegendStyle: Horizontal \n"+ " \n"+ "labelOrientation: Up Angle \n"+ "labelsY: 300 \n"+ "xlabel_font: Arial,N,12 \n"+ "labelColor: #000000 \n"+ "label1: January \n"+ "label2: February \n"+ "label3: March \n"+ "label4: April \n"+ "label5: May \n"+ "label6: June \n"+ "label7: July \n"+ "label8: August \n"+ "label9: September \n"+ "label10: October \n"+ "label11: November \n"+ "label12: December \n"+ " \n"+ "ylabels: true \n"+ "ylabel_font: Arial,N,12 \n"+ "ylabel_pre: $ \n"+ "ylabel_post: \n"+ " \n"+ "title: Graph Title \n"+ "xtitle: X axis title \n"+ "ytitle: Y axis title \n"+ " \n"+ "popupbgcolor: #AAAAFF \n"+ "popupfont: Arial,N,12 \n"+ "popup_pre: $ \n"+ "popup_post: \n"+ " \n"+ " \n"+ " \n"+ " \n"+ " \n"+ " \n"+ " \n"+ " \n"+ " \n"+ "series1: #F00000|6|16|false|Series 1 \n"+ "series2: #F000F0|6|16|true|Series 2 \n"+ "series3: #00F000|0|10|false|Series 3 \n"+ " \n"+ " \n"+ " \n"+ " \n"; return(rsltStr); } //----------------------------------------------------------------------------- } // End class