高分求帮手 在线等
mgan 2006-03-13 10:27:21 geren.html
<!----geren.jsp----------->
<%@ include file="index_top.html"%>
<SCRIPT language=JavaScript src="../css/sh.js"></SCRIPT>
<SCRIPT language=JavaScript src="../css/calendar.js"></SCRIPT>
<SCRIPT language="javascript">
//checkfrom函数用以确保关键字不为空
function checkform(Frm)
{
var flag=true;
if (Frm.branch_no.value=="" || Frm.start_date.value=="" ||Frm.start_date.value=="")
{
alert("机构\开始时间\结束时间不能为空,请检查!");
flag=false;
}
return flag;
}
</SCRIPT>
<html>
<head>
<title>提交表单例子</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
</head>
<body>
<div align="center">
<form id="form1" name="form1" method="post" action="guodu.jsp">
<p>请输入内容</p>
<table width="450" border="0">
<tr>
<td width="112">
<div align="center">代码:</div>
</td>
<td width="112">
<select name="branch_no">
<option selected>请选择</option>
<option value="123000">a1</option>
<option value="12400">a2</option>
</select>
<input type="hidden" name="strPage" value="-1">
</td>
<td width="112">
<div align="center"><IMG src="../image/sj-s.gif" alt="查询标签" width="10" height="10">起始时间:</div>
</td>
<td width="112">
<INPUT class=input
onmouseover="this.style.backgroundColor='#F0F1FF'"
onclick="fPopCalendar(start_date,start_date);judge='1';return false"
onmouseout="this.style.backgroundColor=''" size=10 name=start_date>
</td>
</tr>
<tr>
<td width="112">
<div align="center">代理人工号:</div>
</td>
<td width="112">
<input id="author" type="text" name="sales_no">
</td>
<td width="25%">
<div align="center"><IMG src="../image/sj-s.gif" alt="查询标签" width="10" height="10">结束时间:</div>
</td>
<td width="112">
<INPUT class=input
onmouseover="this.style.backgroundColor='#F0F1FF'"
onclick="fPopCalendar(end_date,end_date);judge='1';return false"
onmouseout="this.style.backgroundColor=''" size=10 name=end_date>
</td>
</tr>
</table>
<br>
<input type="submit" name="Submit" value="查询" onClick="return checkform(form1)">
<input type="reset" name="Submit2" value="重写">
</form>
</div>
</body>
</html>
guodu.jsp
<%@page contentType="text/html;charset=gb2312"%>
<%@page import="java.util.*"%>
<%@page import="java.*"%>
<%@page import="javax.*"%>
<%@page import="java.sql.*,java.lang.Double.*"%>
<%@include file="con_db.jsp"%>
<HTML>
<head>
<title>注册</title>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div>
<%
String branch_no =request.getParameter("branch_no").trim();
String sales_no =request.getParameter("sales_no").trim();
String start_date =request.getParameter("start_date").trim();
String end_date =request.getParameter("end_date").trim();
strSql = "{call dbo.agent_prem_sum_proc(?,?,?,?)}";
sqlStmt = sqlConn.prepareCall(strSql);
sqlStmt.setString(1,start_date);
sqlStmt.setString(2,end_date);
sqlStmt.setString(3,branch_no);
sqlStmt.setString(4,sales_no);
sqlStmt.executeUpdate();
sqlRs.close();
sqlStmt.close();
sqlConn.close();
%>
<jsp:forward page="page_dir.jsp"/>
</div>
</body>
</HTML>
输入内容提交后出现这样的 帮忙看看会是什么原因
这个是con_db.jsp
<!---调用ROCEDURE用的连接数据库用--->
<%@ page session="true" %>
<%@ page import="java.sql.*"%>
<%
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=aadb";
String id="sa";
String password="sa";
Connection sqlConn= DriverManager.getConnection(url,id,password);
CallableStatement sqlStmt=null; //
ResultSet sqlRs = null;
String strSql;
//String user;
//String sysuser;
//String sysuserType;
//String action;
%>
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
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:358)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
root cause
java.lang.NullPointerException
org.apache.jsp.jsp.guodu_jsp._jspService(guodu_jsp.java:86)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
note The full stack trace of the root cause is available in the Tomcat logs.