| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 315 人关注过本帖
标题:登录页面出问题了,大家来看看吧!
只看楼主 加入收藏
glorysea
Rank: 1
等 级:新手上路
帖 子:18
专家分:0
注 册:2007-10-27
收藏
 问题点数:0 回复次数:4 
登录页面出问题了,大家来看看吧!

写了一个简单的登录页面,运行时出现了错误,不知道如何修改,请大家帮忙看看!
错误:
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: 12 in the jsp file: /login.jsp
Generated servlet error:
password cannot be resolved


org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


root cause

org.apache.jasper.JasperException: Unable to compile class for JSP

An error occurred at line: 12 in the jsp file: /login.jsp
Generated servlet error:
password cannot be resolved


org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:414)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:297)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:276)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:264)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:563)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.

源码如下:
<%@ page language="java" contentType="text/html;charset = gb2312"
pageEncoding="gb2312"import="java.sql.*"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%!String StrDBDriver="sun.jdbc.odbc.JdbcOdbcDriver";%>
<%!String StrURL="jdbc:odbc:dl"; %>
<%!String StrDBUser="sa";%>
<%!String StrDBpwd=null; %>
<%!String strSql = null;%>
<%!Connection conn = null;%>
<%!Statement stmt = null;%>
<%!ResultSet rs = null;%>
<%String user=request.getParameter("user");
String passwd=request.getParameter("password");
try{
Class.forName(StrDBDriver).newInstance();
}
catch(ClassNotFoundException ey)
{
out.println("数据库驱动程序没找到!......");

}
catch(Exception ex)
{
out.println("数据库驱动程序没找到!.......");
}
try
{
Connection conn = DriverManager.getConnection(StrURL,"sa","");
//Statement stmt = conn.createStatement();
stmt = conn.createStatement();

out.println("数据库驱动URL正确.....");
if (stmt!=null)
{
//out.println("Connection Sucess!");
rs=stmt.executeQuery("select * from dl where name ='"+user+"' and passwd = '"+password+"'");
}
if(rs!=null)
{
out.println("Login Sucess!,Continue");
}
else
out.println("Connection fail!,try!");
}

catch(SQLException ey)
{
out.println(ey.toString());
out.println("SQLException!");
}
%>
<%@ page contentType = "text/html;charset = gb2312" %>
<html>
<head>
</head>
<body bgcolor =#D7EAFF >
</body>
</html>


搜索更多相关主题的帖子: jsp occurred message request 
2007-10-28 12:12
jameyun520
Rank: 1
等 级:新手上路
帖 子:26
专家分:0
注 册:2007-10-25
收藏
得分:0 
2007-10-28 14:24
aixue
Rank: 1
等 级:新手上路
帖 子:27
专家分:0
注 册:2007-10-28
收藏
得分:0 
2007-10-28 14:36
muxzi
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2007-10-28
收藏
得分:0 
看了
不懂
学习中...
2007-10-28 15:18
wang_2012
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2007-1-12
收藏
得分:0 
现在要把一些图片写进数据库。不知道这么弄。希望高手给些代码。谢谢
不是存放图片的地址,而是把图片以二进制写到数据库里。然后读取出来
2007-10-28 15:24
快速回复:登录页面出问题了,大家来看看吧!
数据加载中...
 
   



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

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