import java.sql.*; import java.lang.*; import*; import javax.servlet.*; import javax.servlet.http.*; public class AreaConfigServlet 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, // // //----------------------------------------------------------------------------- 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 = "3D: false\n"+ "grid: true\n"+ "axis: true\n"+ "ylabels: true\n"+ "outline: true\n"+ "legend: true\n"+ "autoscale: true\n"+ "width: 460\n"+ "height: 440\n"+ "nPoints: 12\n"+ "nRows: 7\n"+ "vSpace: 30\n"+ "nSeries: 3\n"+ "hSpace: 30\n"+ "gridxpos: 75\n"+ "gridypos: 350\n"+ "gridstyle: 3\n"+ "depth3D: 15\n"+ "ndecplaces: 0\n"+ "labelOrientation: 0\n"+ "labelsY: 365\n"+ "chartScale: 2000\n"+ "chartStartY: 0\n"+ "labelsYpre: $\n"+ "labelsYpost: \n"+ "label1: Jan\n"+ "label2: Feb|10\n"+ "label3: Mar\n"+ "label4: Apr|10\n"+ "label5: May\n"+ "label6: Jun|10\n"+ "label7: Jul\n"+ "label8: Aug|10\n"+ "label9: Sep\n"+ "label10: Oct|10\n"+ "label11: Nov\n"+ "label12: Dec|10\n"+ "yFont: Arial,N,10\n"+ "xFont: Arial,N,12\n"+ "BackgroundColor: 255,255,255\n"+ "gridbg: #EEEEFF\n"+ "BgColor: white\n"+ "gridcolor: 70,70,70\n"+ "axiscolor: 0,0,255\n"+ "floorcolor: 0,100,170\n"+ "outlinecolor: 0,0,0\n"+ "labelcolor: 50,50,50\n"+ "Ycolor: 50,50,50\n"+ "legendfont: Arial,N,10\n"+ "legendposition: 300,5\n"+ "legendtitle: Products\n"+ "LegendBackground: #EEEEFF\n"+ "LegendBorder: 0,50,175\n"+ "LegendtextColor: 50,50,50\n"+ "title: Sales by Year|80,60|Arial,BI,18|100,100,200\n"+ "xtitle: Year 2002|200,420|Arial,B,16|100,100,200\n"+ "ytitle: Value $|10,300|Arial,B,16|100,100,200\n"+ "text1: Note :|80,85|Arial,N,10|100,100,200\n"+ "text2: Product Z launched April|85,100|Arial,N,10|50,50,50\n"+ "text3: Product Y discontinued in October|85,115|Arial,N,10|50,50,50\n"+ "series1: 99,99,156|0|8|false|Product X\n"+ "series2: 8,185,185|0|8|true|Product Y\n"+ "series3: 239,154,65|0|8|false|Product Z\n"+ "target1: 0,125,0|4|1|12|10500|Target|Arial,B,12\n"+ "target2: 125,0,0|4|1|12|8300|Break Even|Arial,B,12\n"; return(rsltStr); } //----------------------------------------------------------------------------- } // End class