求救。。。家庭理财管理
HTTP Status 500 -
--------------------------------------------------------------------------------
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: An exception occurred processing JSP page /balance.jsp at line 24
21: }
22: Float mTotalM = (Float)session.getAttribute("mTotal");
23: session.removeAttribute("mTotal");
24: float mTotal = mTotalM.floatValue();
25: %>
26: <html>
27: <head>
每次打开网页,点击收支情况查看就会提示这个错误。。
balance.jsp 代码如下
<%@ page contentType="text/html;charset=GBK"%>
<%@ page import="java.util.Date"%>
<%@ page import="java.text.SimpleDateFormat"%>
<%@ page import="java.sql.*"%>
<%@ page import="family.yin.senqi.dao.*" %>
<%@ page import="family.yin.senqi.model.*"%>
<%
request.setCharacterEncoding("GBK");
String nYear = request.getParameter("nYear");
String nMonth = request.getParameter("nMonth");
int month = 1;
if(nMonth!=null && !"".equals(nMonth)){
month = new Integer(nMonth).intValue();
}
ModelFour[] mf = (ModelFour[])session.getAttribute("mf");
if(mf!=null && mf.length>0){
session.removeAttribute("mf");
}
Float mTotalM = (Float)session.getAttribute("mTotal");
session.removeAttribute("mTotal");
float mTotal = mTotalM.floatValue();
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>行车消费</title>
</head>
<script src="js/iOffice_Popup.js"></script>
<script src="js/calendar.js"></script>
<script src="js/check_ywxt.js"></script>
<script>
</script>
<style type="text/css">
<!--
.chart_list {
border-collapse:collapse;
border-bottom-style:solid;
border-bottom-width:1px;
border-bottom-color:#666666;
border-left-style:solid;
border-left-width:1px;
border-left-color:#666666;
background-color:#FFFFFF;
font-size:14px;
}
.chart_list td{
border-top-style:solid;
border-top-width:1px;
border-top-color:#666666;
border-right-style:solid;
border-right-width:1px;
border-right-color:#666666;
}
-->
</style>
<body>
<form name="myForm" method="post" action="balance.look">
<table width="60%" border="0" cellspacing="0" cellpadding="0" align="center" class="chart_list">
<tr>
<td align='center' valign='middle' colspan="2">
时间:<select name="nYear">
<option value="2006">2006</option>
<option value="2007">2007</option>
</select>年
<select name="nMonth" onChange="document.myForm.submit()">
<%
for(int i=1;i<=12;i++){
%>
<option value="<%=i%>" <%=i==month?"selected":""%>><%=i%></option>
<%
}
%>
</select>
月
</td>
</tr>
<tr>
<td height="25" colspan="2" align="center" bgcolor="#FBEAD0">支出明细
</td>
</tr>
<tr>
<td width="66%" height="25" align="center">时间</td>
<td width="33%" align="center">金额</td>
</tr>
<%
float f=0;
if(mf!=null && mf.length>0){
for(int i=0;i<mf.length;i++){
%>
<tr onMouseOver="this.style.cursor='hand',this.style.color='red'" onMouseOut="this.style.color='#000000'" onClick="parent.mainFrame.location='everydayTotal.jsp?cTime=<%=mf[i].getRecTime()%>'">
<td height="19" align="center"><%=mf[i].getRecTime()%></td>
<td align="center"><%=mf[i].getTotalMoney()%></td>
</tr>
<%
f+=mf[i].getTotalMoney();
}
}
%>
<tr>
<td height="25" align="center">总计</td>
<td align="center"><%=f%></td>
</tr>
<tr>
<td height="25" align="center">月收入</td>
<td align="center"><%=mTotal%></td>
</tr>
<tr>
<td height="25" align="center">节余</td>
<td align="center"><%=mTotal-f%></td>
</tr>
</table>
<br>
</form>
</body>
</html>
除此之外,在clothes.jsp页面,只能看见数据库内容,但是不能添加数据。。clothes.jsp代码如下
<%@ page contentType="text/html;charset=GBK"%>
<%@ page import="java.util.Date"%>
<%@ page import="java.text.SimpleDateFormat"%>
<%@ page import="java.sql.*"%>
<%@ page import="family.yin.senqi.dao.*"%>
<%@ page import="family.yin.senqi.model.*"%>
<%
request.setCharacterEncoding("GBK");
String recTime = request.getParameter("cTime");
if(recTime==null || "".equals(recTime)){
Date ndate = new Date();
SimpleDateFormat s = new SimpleDateFormat("yyyy-MM-dd");
recTime = s.format(ndate);
}
MyDAO dao = new MyDAO();
String indexid = dao.getIndexid(recTime);
if(indexid==null || "".equals(indexid)){
System.out.println("======now insert new recTime======:"+recTime);
dao.insertRecTime(recTime);
indexid = dao.getIndexid(recTime);
}
ModelOne[] mo = dao.getMyTableResults(1,indexid);
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<title>着装消费</title>
</head>
<script src="js/iOffice_Popup.js"></script>
<script src="js/calendar.js"></script>
<script src="js/check_ywxt.js"></script>
<script>
function doSubmit(){
if(!(InputValid(document.myForm.name,1,'string',1,1,1000,'购买物品')))return;
if(!(InputValid(document.myForm.person,1,'string',1,1,1000,'购买者')))return;
if(!(InputValid(document.myForm.money,1,'float',1,1,10000,'购买价格')))return;
document.myForm.action="clothse.input";
document.myForm.submit();
}
function doDelete(id){
if(confirm("确定要删除吗?")==true){
document.myForm.recId.value=id;
document.myForm.action="clothse.input";
document.myForm.submit();
}else return;
}
function chooseTime(){
openCalendarDlg(document.myForm.cTime,'<%=request.getContextPath()%>');
document.myForm.action="clothse.jsp";
document.myForm.submit();
}
</script>
<style>
.chart_list{
border-collapse:collapse;
border-bottom-style:solid;
border-bottom-width:1px;
border-bottom-color:#666666;
border-left-style:solid;
border-left-width:1px;
border-left-color:#666666;
background-color:#FFFFFF;
font-size:14px;
}
.chart_list td{
border-top-style:solid;
border-top-width:1px;
border-top-color:#666666;
border-right-style:solid;
border-right-width:1px;
border-right-color:#666666;
}
.aa{
background-color:#FFFF33;
}
.bb{
background-color:#FFFFFF;
}
</style>
<body>
<form name="myForm" method="post" action="">
<input type="hidden" name="toPage" value="clothse.jsp">
<input type="hidden" name="recTime" value="<%=recTime%>">
<input type="hidden" name="recId" value="">
<input type="hidden" name="table" value="1">
<input type="hidden" name="indexid" value="<%=indexid%>">
<table width="60%" border="0" cellspacing="0" cellpadding="0" align="center" class="chart_list">
<tr>
<td align='center' valign='middle' colspan="2" bgcolor="#FBEAD0">
时间:<input name='cTime' type='text' size='10' style='font-size:13px' value="<%=recTime%>">
<input name='button' type='button' value='选择' onclick='chooseTime()'>
</td>
</tr>
<tr>
<td height="25" align="right" width="40%">购 买 者:</td>
<td><input type="radio" name="person" value="1" checked>
老婆
<input type="radio" name="person" value="2">
猪头 </td>
</tr>
<tr>
<td height="25" align="right">购买物品:</td>
<td><input type="text" name="name"></td>
</tr>
<tr>
<td height="25" align="right">购买价格:</td>
<td><input type="text" name="money"></td>
</tr>
<tr>
<td height="25" colspan="2" align="center">
<input type="button" value="提 交" onClick="doSubmit()"></td>
</tr>
</table>
<br>
<table width="60%" border="0" cellspacing="0" cellpadding="0" align="center" class="chart_list">
<tr>
<td height="25" align="center" width="25%">操作
<td height="25" align="center" width="25%">购买物品</td>
<td height="25" align="center" width="25%">购买者</td>
<td height="25" align="center" width="25%">购买价格</td>
</td>
</tr>
<%
float f = 0;
if(mo!=null && mo.length>0){
int length = mo.length;
for(int i=0;i<length;i++){
%>
<tr>
<td height="25" align="center"><a href="#" onClick="doDelete(<%=mo[i].getId()%>)" >删 除</a>
<td height="25" align="center"><%=mo[i].getName()%></td>
<td height="25" align="center"><%=mo[i].getPerson()==1?"老婆":"老公"%></td>
<td height="25" align="center"><%=mo[i].getMoney()%></td>
</tr>
<%
f+=mo[i].getMoney();
}
}
%>
<tr>
<td height="25" colspan="3" align="center">总计</td>
<td height="25" align="center"><%=f%></td>
</tr>
</table>
</form>
</body>
</html>