| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 610 人关注过本帖
标题:[求助]看看有什么错误
只看楼主 加入收藏
wxmm2003
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2006-4-14
收藏
 问题点数:0 回复次数:2 
[求助]看看有什么错误

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: Unable to compile class for JSP

An error occurred at line: 2 in the jsp file: /right/research/declare/conn.jsp

Generated servlet error:
[javac] Compiling 1 source file

G:\Tomcat 5.0\work\Catalina\localhost\myapp\org\apache\jsp\right\research\declare\login_005fconfirm_jsp.java:23: cannot find symbol
symbol : method forNam(java.lang.String)
location: class java.lang.Class
Class.forNam("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
^

An error occurred at line: 6 in the jsp file: /right/research/declare/login_confirm.jsp

Generated servlet error:
G:\Tomcat 5.0\work\Catalina\localhost\myapp\org\apache\jsp\right\research\declare\login_005fconfirm_jsp.java:109: cannot find symbol
symbol : class Sting
location: class org.apache.jsp.right.research.declare.login_005fconfirm_jsp
String pwd=new Sting(request.getParameter("passwords"));
^

An error occurred at line: 6 in the jsp file: /right/research/declare/login_confirm.jsp

Generated servlet error:
Note: G:\Tomcat 5.0\work\Catalina\localhost\myapp\org\apache\jsp\right\research\declare\login_005fconfirm_jsp.java uses unchecked or unsafe operations.

An error occurred at line: 6 in the jsp file: /right/research/declare/login_confirm.jsp

Generated servlet error:
Note: Recompile with -Xlint:unchecked for details.
2 errors


org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:127)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:351)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:415)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:458)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:553)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:291)
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.


--------------------------------------------------------------------------------

Apache Tomcat/5.0.19


数据库的连接为
<%@ page import="java.sql.*"%>
<%!
Connection conn = null;
Statement stmt = null;
ResultSet rs = null;
public void jspInit() //执行数据库连结动作
{
try
{
Class.forNam("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();
String url="jdbc:microsoft:sqlserver://WP:1433;DatabaseName=db_Research";
String user="sa";
String password="";
Connection conn= DriverManager.getConnection(url,user,password);
Statement stmt=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);
}
catch(Exception ex)
{
System.out.println(ex.toString());
}
}
public void jspDestroy() //关闭变量
{
try
{
rs.close();
stmt.close();
conn.close();
}
catch(Exception ex)
{
System.out.println(ex.toString());
}
}
String ToGB2312(String str)
{
byte GB2312[]=new byte[str.length()];
for(int i=0;i<str.length();i++)
{
GB2312[i]=(byte)str.charAt(i);
}
return new String(GB2312);
}

%>

登陆界面为
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>登陆</title>
<style type="text/css">
<!--
.style1 { font-size: 14px;
color: #0000FF;
}
-->
</style>
<link href="../css/style.css" rel="stylesheet">
<script language="javascript">
<!--
function check(){
if(form1.users.value==""){
alert("请输入申报员登录名称");
form1.users.focus();
return false;
}
if(form1.passwords.value==""){
alert("请输入申报员密码");
form1.passwords.focus();
return false;
}
}
-->
</script>
</head>

<body>
<p>&nbsp;</p>
<p>&nbsp;</p>
<table width="300" height="121" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#ffffff" bordercolordark="#D6E3D6" bordercolorlight="#FFFFFF">
<form action="login_confirm.jsp" method="post" name="form1">
<tr align="center" valign="middle" bgcolor="#F7F3EF">
<td height="30" colspan="2"><span class="style1">申报员登录</span></td>
</tr>
<tr>
<td height="30" align="center" valign="middle">用户名:</td>
<td width="172" align="left" valign="middle"><input name="users" type="text" class="txt_grey" id="users" style="width:120pt;">
</td>
</tr>
<tr>
<td height="30" align="center" valign="middle">密&nbsp;&nbsp;码:</td>
<td height="30" align="left" valign="middle"><input name="passwords" type="password" class="txt_grey" id="passwords" style="width:120pt;">
</td>
</tr>
<tr align="center" bgcolor="#F7F3EF">
<td height="30" colspan="2" valign="middle"><input name=substr type="submit" class="btn_grey" onClick="return check()" value="提交">
&nbsp;&nbsp;
<input name="Submit2" type="reset" class="btn_grey" value="重置"></td>
</tr>
</form>
</table>

</body>
</html>

登陆验证为:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<%@ page import="java.util.*"%>
<%@ page import="java.util.Date"%>
<%@ page import="java.text.*"%>
<%@ include file="conn.jsp" %>
<%
String name=new String(request.getParameter("users"));
String pwd=new Sting(request.getParameter("passwords"));
String sql="select * from tb_user where users='"+name+"' and passwords='"+pwd+"'+ and levels='申报员'";
rs=stmt.executeQuery(sql);
if(rs.next()){
session.setAttribute("users",name);
session.setAttribute("passwords",pwd);
%>
<script language=javascript>
alert('登录成功 进入申报首页');
window.location="../declare.htm";
</script>
<% }
else{
%>
<script language=javascript>
alert('输入申报员名或密码有误');
window.location="login.jsp"</script>
<%
}
%>



各位大虾帮帮忙
看看是什么原因
希望各位都给回复一下
谢谢
本人有急用

搜索更多相关主题的帖子: The jsp jasper 
2006-04-21 20:36
wxmm2003
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2006-4-14
收藏
得分:0 
??????
2006-04-21 20:51
疯子java
Rank: 4
等 级:贵宾
威 望:13
帖 子:328
专家分:0
注 册:2004-9-19
收藏
得分:0 
G:\Tomcat 5.0\work\Catalina\localhost\myapp\org\apache\jsp\right\research\declare\login_005fconfirm_jsp.java:23: cannot find symbol
symbol : method forNam(java.lang.String)
location: class java.lang.Class
Class.forNam("com.microsoft.jdbc.sqlserver.SQLServerDriver").newInstance();

方法不能定位,即找不到这个方法

Generated servlet error:
G:\Tomcat 5.0\work\Catalina\localhost\myapp\org\apache\jsp\right\research\declare\login_005fconfirm_jsp.java:109: cannot find symbol
symbol : class Sting
location: class org.apache.jsp.right.research.declare.login_005fconfirm_jsp
String pwd=new Sting(request.getParameter("passwords"));

Sting这个类找不到

这些都是很简单的问题哈,注意检查哈

疯言疯语 疯部可及 ---世界法第1章第1节第1条规定 此人由于说话太过于疯!!!其余人等切不可与其交谈! 此人由于说话太过于疯!!!此人的话100%的不能相信
2006-04-22 15:36
快速回复:[求助]看看有什么错误
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.028589 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved