我的JSP页面都正常,只是一连接数据库就报错
HTTP Status 500 -
请问我用什么办法能解决这个问题啊?谢谢了
HTTP Status 500 -
请问我用什么办法能解决这个问题啊?谢谢了
解决方案 »
- web问题求帮助
- 判断表单的某个字段是否修改
- 请问在Struts中,在action中已经将数据集提取出来了,怎么样把它提交到jsp中?我开始用session,后来用formbean,想知道怎么用formbean把数据
- jsp 连接sqlserver2000数据库问题
- 请教一个HQL语句的写法
- *****关于连接池的Datasource**********
- 请问,含有javax.servlet.*;的*.jar文件在那个包里,在线等
- 在JSP中调用BEAN无法找到指顶的CLASS文件,如何解决
- 开始学java,jsp;win98+64M内存+c366+宽带上网 高手们提点意见
- jsp的bug???
- 请问response.setHeader("Pragma", "public");是什么意思?
- Tomcat测试问题(在线等)
<%try{你的代码}catch(Exception e){
System.out.println(e.toString());
}%>
看后台有没有抛什么出来。
<%@ page import="myclass.DealString"%>
<jsp:useBean id="alogin" scope="page" class="myclass.Login" />
<%
String mesg = "";if( request.getParameter("ManagerID")!=null && !request.getParameter("ManagerID").equals("")){
String ManagerID =request.getParameter("ManagerID");
String password = request.getParameter("password");
ManagerID = new String(ManagerID.getBytes("ISO8859-1"));
password = new String(password.getBytes("ISO8859-1"));
alogin.setManagerID(ManagerID);
alogin.setpassword(password);
if (alogin.excute()){
session.setAttribute("ManagerID",ManagerID);
response.sendRedirect("borrowBooks.jsp");
%>
<%
}else {
mesg = "登录出错!" ;
}
}
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /><title>图书借阅系统:</title><link href="abc.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
a:link {
text-decoration: none;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
}
.a1 {
border-right-width: 1px;
border-top-style: none;
border-right-style: solid;
border-bottom-style: none;
border-left-style: none;
border-right-color: #CCCCCC;
}
.STYLE2 {font-size: 14px}
.STYLE5 {font-size: 14px; color: #FF0000; }
-->
</style>
</head><body>
<table width="829" border="0" align="center" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="250" height="80" valign="top"><img src="img/logo.gif"/></td>
<td width="579" valign="top"><!--DWLayoutEmptyCell--> </td>
</tr>
<tr>
<td height="25" valign="bottom" background="img/INDEX_r2_c1.jpg" class="STYLE2"><%=DealString.getDateTime()%></td>
<td align="left" valign="middle" background="img/INDEX_r2_c1.jpg"><marquee scrollamount=4 class="STYLE2" onmouseover=this.stop() onmouseout=this.start()>图书借阅系统欢迎你的到来:
</marquee></td>
</tr>
</table>
<table width="829" border="0" align="center" cellpadding="0" cellspacing="0" class="abc">
<td width="829" height="75" align="center" valign="middle"><p><span class="STYLE2">图书城管理员登录!</span></p>
<p class="STYLE5">
<%=mesg%>
</p></td>
</tr>
<tr>
<td height="299" valign="top" class="STYLE2"><form action="" method="post" >
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="46%" height="20" align="right" valign="bottom"><span class="STYLE2">管理员ID</span>:</td>
<td width="54%" align="left" valign="bottom"><input type="text" name="ManagerID"></td>
</tr>
<tr>
<td height="20" align="right" valign="bottom" class="STYLE2">管理员密码:</td>
<td align="left" valign="bottom"><input type="password" name="password"></td>
</tr>
<tr>
<td height="20" align="right" valign="bottom"><input type="submit" name="Submit" value="提交"></td>
<td align="left" valign="bottom"><input type="reset" name="Submit2" value="重置"></td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td width="100%" height="20" align="right" valign="bottom"><a href="sevlet.jsp">点击进入查询页面</a></td>
</tr>
</table>
<table width="829" border="0" cellpadding="0" cellspacing="0" align="center">
<!--DWLayoutTable-->
<tr>
<td width="829" height="20">
<DIV align=center class="STYLE2">
Copyright © wanglihua01.COM, All Rights Reserved.</DIV></td>
</tr>
</table>
</body>
</html>
这是程序代码,
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause java.lang.NullPointerException
myclass.Login.excute(Login.java:47)
org.apache.jsp.index1_jsp._jspService(index1_jsp.java:66)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.0.28 logs.这是出错信息,谢谢你们了!帮忙看看,还有我代码上面显示的时间和电脑时间怎么不对?
打开企业管理器-工具-SQL Server配置属性-安全性
把身份验证改为SQL Server和Windows[s]
C:\Program Files\Microsoft SQL Server\MSSQL$A\Data