jsp图形展示页面

<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
   
    <title>My JSP 'MyJsp.jsp' starting page</title>
   
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">   
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->

<script language="javascript" type="text/javascript">
function createXmlHttpRequest(){
if(window.ActiveXObject){
return new ActiveXObject("Microsoft.XMLHTTP");
}else if(window.XMLHttpRequest){
return new XMLHttpRequest();
}
}
var xmlHttpRequest;
function testdx(){
var str;
var t=0;
var radios=document.getElementsByName("radio");
for(var i=0;i<radios.length;i++){
if(radios[i].checked==true){
str=radios[i].value;
}
}
if(str=="联系人类型"){
t=0
}else if(str=="公司"){
t=1
}else if(str=="职业"){
t=2
}else if(str=="职位"){
t=3
}else if(str=="职称"){
t=4
}else if(str=="城市"){
t=5
}else if(str=="性别"){
t=6
}
var url="contactInfo.do?method=createPie&radioName="+t;
t=-1;
xmlHttpRequest=createXmlHttpRequest();
xmlHttpRequest.onreadystatechange=haoLeJiaoWo;
xmlHttpRequest.open("post",url,true);
xmlHttpRequest.send(null);
}
function haoLeJiaoWo(){
if(xmlHttpRequest.readyState==4&& xmlHttpRequest.status==200){
var std=document.getElementById("images");
std.src=xmlHttpRequest.responseText;
}

}
</script>
</head>

<body onload="testdx();">
<table width="100%" height="100%" border="1">
  <tr>
    <td width="120" height="27" align="center"><strong>图表分析</strong></td>
       <td width="1092">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="1020"><center><strong>图表显示区</strong></center></td>
  <td width="50"><input type="button" align="left" value="关闭" onclick="window.close();" /></td>
</tr>
</table>
</td>
  </tr> 
  <tr>
    <td width="120">
<form action="" method="post" id="form1">
<table cellpadding="3" cellspacing="2" border="0" align="center" height="550" width="118">
<tr><td><input type="radio" id="radio" name="radio" value="联系人类型" onclick="testdx();" checked="checked"/>联系人类型 </td></tr>
<tr><td><input type="radio"  name="radio" value="公司" onclick="testdx();"/>公司</td></tr>
<tr><td><input type="radio"  name="radio" value="职业" onclick="testdx();"/>职业</td></tr>
<tr><td><input type="radio"  name="radio" value="职位" onclick="testdx();"/>职位</td></tr>
<tr><td><input type="radio"  name="radio" value="职称" onclick="testdx();"/>职称</td></tr>
<tr><td><input type="radio"  name="radio" value="城市" onclick="testdx();"/>城市</td></tr>
<tr><td><input type="radio"  name="radio" value="性别" onclick="testdx();"/>性别</td></tr>
</table>
</form>
</td>
<td width="920" rowspan="8">
<img id="images" name="images" border="1" width="900",height="550">
</td>
  </tr>
</table>
</body>
</html>
/***************************bing************************/
<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<%@page import="crm.web.action.Photos"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ page import="java.io.PrintWriter"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
   
    <title>My JSP 'bing.jsp' starting page</title>
   
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">   
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
     
  </head>
   <%
//饼状图
String fileNamePie=Photos.generatePieChart(session,new PrintWriter(out),800,600,"asdf");
String graphURLPie = request.getContextPath() + "/servlet/DisplayChart?filename=" + fileNamePie;
%>
  <body>
    <img src="<%= graphURLPie %>" width=800 height=600 border=1 />
  </body>
</html>

你可能感兴趣的:(java,html,jsp,Microsoft,bing)