jsp代码:<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>账簿管理--详细</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript" src="js/common.js"></script>
<script type="text/JavaScript">
function sub(){
document.frm3.submit();
}</script>
<% dp_booksDAO bbd= new dp_booksDAO();
booksEntity eb =new booksEntity();
String no = request.getParameter("Dp_no");
eb.setDp_no(Integer.parseInt(no));
booksEntity eb2 = bbd.selectbooks(eb);
%>
</head><body leftmargin="0" topmargin="0" onLoad="MM_preloadImages('images/login_10.gif','images/login_12.gif','images/login_09.gif','images/login_11.gif')">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="32" align="left" valign="top" class="text006"><table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
<td>【 账簿管理 】</td>
<td align="right"> </td>
</tr>
</table></td>
</tr>
<%
familyEntity ef1=new familyEntity();
itemEntity ei1=new itemEntity();
ef1.setMember_no(eb2.getMember_no());
ei1.setItem_no(eb2.getItem_no());
String a=bbd.select1(ef1).getMember_name();
String b=bbd.select2(ei1).getDp_name();
String c=bbd.select2(ei1).getType();
%>
<tr>
<td height="215" valign="top"><table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr align="left" class="bg03">
<td width="100%" height="29">
<span class="text001"> 删除收支记录</span></td>
</tr> </table>
<table width="98%" border="0" cellpadding="0" cellspacing="0" class="text008">
<tr align="center">
<td width="12%" height="35" align="right">收支项目:</td>
<td width="88%" align="left" ><%=b%></td>
</tr>
<tr align="center" class="bg04">
<td height="35" align="right">收支日期:</td>
<td align="left"> <%=eb2.getDp_date() %></td>
</tr>
<tr align="center">
<td height="35" align="right">收支家庭成员:</td>
<td align="left"> <%=a%></td>
</tr>
<tr align="center" class="bg04">
<td height="35" align="right">收支金额:</td>
<td align="left"> <%=eb2.getDp_amount() %></td>
</tr>
<tr align="center">
<td height="36" align="right" valign="top" ><div class="mar009">备注:</div></td>
<td align="left" valign="top"><div class="mar009"> <%=eb2.getRe() %></div> </td>
</tr>
</table>
<form action="delete.do" method="post" name="frm3">
<input type="hidden" name="dp_no" value="<%=eb2.getDp_no()%>">
<table width="98%" border="0" cellpadding="0" cellspacing="0" class="bor001">
<tr>
<td width="22%" height="40" align="center" ><img onMouseOver="MM_swapImage('Image1','','images/index_12_1.gif',1)" onMouseOut="MM_swapImgRestore()" onMouseDown="MM_swapImage('Image1','','images/index_12_2.gif',1)" onMouseUp="MM_swapImage('Image1','','images/index_12_1.gif',1)" onClick="sub()" src="images/index_12_0.gif" name="Image1" width="75" height="24" border="0" id="Image1"> <a href="zpgl.jsp" target="mainframe" onMouseOver="MM_swapImage('Image2','','images/login_09.gif',1)" onMouseOut="MM_swapImgRestore()" onMouseDown="MM_swapImage('Image2','','images/login_11.gif',1)" onMouseUp="MM_swapImage('Image2','','images/login_09.gif',1)"><img src="images/login_07.gif" name="Image2" width="75" height="24" border="0" id="Image2"></a></td>
<td width="78%" align="right"> </td>
</tr>
</table></form></td>
</tr>
</table>
</body>
</html>
我用的Struts框架开发的,小弟是新手,
action代码如下:
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;import com.ambow.form.booksForm;
import com.ambow.form.booksForm;
import com.ambow.jdbc.dp_booksDAO;
import com.ambow.jdbc.dp_booksDAO;
public class bp_delete extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
booksForm bpb=(booksForm)form;
int dp_no = bpb.getDp_no();
dp_booksDAO bpd=new dp_booksDAO();
if(bpd.bp_delete(dp_no)){
return mapping.findForward("sucess");
}
else{
return mapping.findForward("error");
}
}
}
这是一个实现删除功能的模块,运行后出现
严重: Servlet.service() for servlet jsp threw exception
java.lang.NumberFormatException: null这个错误~
请高手指点~~
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>账簿管理--详细</title>
<link href="css/style.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript" src="js/common.js"></script>
<script type="text/JavaScript">
function sub(){
document.frm3.submit();
}</script>
<% dp_booksDAO bbd= new dp_booksDAO();
booksEntity eb =new booksEntity();
String no = request.getParameter("Dp_no");
eb.setDp_no(Integer.parseInt(no));
booksEntity eb2 = bbd.selectbooks(eb);
%>
</head><body leftmargin="0" topmargin="0" onLoad="MM_preloadImages('images/login_10.gif','images/login_12.gif','images/login_09.gif','images/login_11.gif')">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="32" align="left" valign="top" class="text006"><table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top">
<td>【 账簿管理 】</td>
<td align="right"> </td>
</tr>
</table></td>
</tr>
<%
familyEntity ef1=new familyEntity();
itemEntity ei1=new itemEntity();
ef1.setMember_no(eb2.getMember_no());
ei1.setItem_no(eb2.getItem_no());
String a=bbd.select1(ef1).getMember_name();
String b=bbd.select2(ei1).getDp_name();
String c=bbd.select2(ei1).getType();
%>
<tr>
<td height="215" valign="top"><table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr align="left" class="bg03">
<td width="100%" height="29">
<span class="text001"> 删除收支记录</span></td>
</tr> </table>
<table width="98%" border="0" cellpadding="0" cellspacing="0" class="text008">
<tr align="center">
<td width="12%" height="35" align="right">收支项目:</td>
<td width="88%" align="left" ><%=b%></td>
</tr>
<tr align="center" class="bg04">
<td height="35" align="right">收支日期:</td>
<td align="left"> <%=eb2.getDp_date() %></td>
</tr>
<tr align="center">
<td height="35" align="right">收支家庭成员:</td>
<td align="left"> <%=a%></td>
</tr>
<tr align="center" class="bg04">
<td height="35" align="right">收支金额:</td>
<td align="left"> <%=eb2.getDp_amount() %></td>
</tr>
<tr align="center">
<td height="36" align="right" valign="top" ><div class="mar009">备注:</div></td>
<td align="left" valign="top"><div class="mar009"> <%=eb2.getRe() %></div> </td>
</tr>
</table>
<form action="delete.do" method="post" name="frm3">
<input type="hidden" name="dp_no" value="<%=eb2.getDp_no()%>">
<table width="98%" border="0" cellpadding="0" cellspacing="0" class="bor001">
<tr>
<td width="22%" height="40" align="center" ><img onMouseOver="MM_swapImage('Image1','','images/index_12_1.gif',1)" onMouseOut="MM_swapImgRestore()" onMouseDown="MM_swapImage('Image1','','images/index_12_2.gif',1)" onMouseUp="MM_swapImage('Image1','','images/index_12_1.gif',1)" onClick="sub()" src="images/index_12_0.gif" name="Image1" width="75" height="24" border="0" id="Image1"> <a href="zpgl.jsp" target="mainframe" onMouseOver="MM_swapImage('Image2','','images/login_09.gif',1)" onMouseOut="MM_swapImgRestore()" onMouseDown="MM_swapImage('Image2','','images/login_11.gif',1)" onMouseUp="MM_swapImage('Image2','','images/login_09.gif',1)"><img src="images/login_07.gif" name="Image2" width="75" height="24" border="0" id="Image2"></a></td>
<td width="78%" align="right"> </td>
</tr>
</table></form></td>
</tr>
</table>
</body>
</html>
我用的Struts框架开发的,小弟是新手,
action代码如下:
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;import com.ambow.form.booksForm;
import com.ambow.form.booksForm;
import com.ambow.jdbc.dp_booksDAO;
import com.ambow.jdbc.dp_booksDAO;
public class bp_delete extends Action {
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) {
booksForm bpb=(booksForm)form;
int dp_no = bpb.getDp_no();
dp_booksDAO bpd=new dp_booksDAO();
if(bpd.bp_delete(dp_no)){
return mapping.findForward("sucess");
}
else{
return mapping.findForward("error");
}
}
}
这是一个实现删除功能的模块,运行后出现
严重: Servlet.service() for servlet jsp threw exception
java.lang.NumberFormatException: null这个错误~
请高手指点~~
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货