
<%@ page contentType="text/html;charset=gb2312"%>
<%@ page import = "zxj.CounterForm"%>

<!--初始化，设置一些属性-->
<jsp:useBean id="counterForm" class="zxj.CounterForm" scope="request"/>

<html>
<head> 
<title>字母使用频率统计</title>
</head>
<body>
<%
	String resourceFile = counterForm.getResource();
	//中文字符转换处理
	resourceFile = new String(resourceFile.getBytes("iso8859-1"));
	int total =counterForm.getTotal();
	int otherf = counterForm.getOtherf();
	int result[] = new int[26];
	float rate[] = new float[27];
	
	
	for(int i=0;i<26;i++)
	{
		result[i] = 0;
	}
	for(int i=0;i<27;i++)
	{
		rate[i] = 0;
	}
	result = counterForm.getResult();
	rate = counterForm.getRate();
	char rsChar[] =new char[]{'a','b','c','d','e','f','g',
				  'h','i','j','k','l','m','n',
				  'o','p','q','r','s','t',
				  'u','v','w','x','y','z',
					};
        
%>
<center>
<p><font size = 7 color =blue><strong>字 母 使 用 频 率 统 计 报 表</strong></font></p>
<br>
<hr color=red>

<p><font  color =blue>你选择的文件路径为：<%=resourceFile %></font></p>
<table border = 1>
<tr>
<td align=center width=100>
	字母
</td>
<td align=center width=100>
	次数
</td >
<td align=center width=180>
	使用频率
</td>
<td align=center width=100>
	字母
</td>
<td align=center width=100>
	次数
</td >
<td align=center width=180>
	使用频率
</td>
</tr>
<%
	for(int i=0;i<26;i++)
	{
		out.print("<tr>");
		out.print("<td align=center>"+rsChar[i]+"</td>");
		out.print("<td align=center>"+result[i]+"</td>");
		out.print("<td align=center>"+rate[i]+"</td>");
		i++;
		out.print("<td align=center>"+rsChar[i]+"</td>");
		out.print("<td align=center>"+result[i]+"</td>");
		out.print("<td align=center>"+rate[i]+"</td>");
	}	
		
%>
		


</center>
</body>
</html>