学习JSP的时候遇到的路径问题

weigame666 2004-10-10 10:09:43
就是一个比较流行的办公室系统其中的一个文件用TOMCAT运行后变成下面这样
HTTP Status 500 -

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

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

javax.servlet.ServletException: ?????????.
org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
org.apache.jsp.learn_jsp._jspService(learn_jsp.java:141)
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)


root cause

java.sql.SQLException: ?????????.
org.zhengmao.soft.sqlcon.(sqlcon.java:40)
org.apache.jsp.learn_jsp._jspService(learn_jsp.java:71)
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.

下面付了源代码
<%@ page contentType="text/html;charset=gb2312" %>
<%@ page import="java.util.*" %>
<jsp:useBean id="sqlbean" scope="session" class="org.zhengmao.soft.sqlcon" />
<jsp:useBean id="mychar" scope="session" class="org.zhengmao.soft.gb_unicode" />
<script language=javascript src="mouse.js"></script>

<%
String name = sqlbean.to_8859_1(request.getParameter("name"));
String password = sqlbean.to_8859_1(request.getParameter("password"));
String username = sqlbean.to_8859_1(request.getParameter("username"));
String question = sqlbean.to_8859_1(request.getParameter("question"));
String answer = sqlbean.to_8859_1(request.getParameter("answer"));
String email = sqlbean.to_8859_1(request.getParameter("email"));
String mobile = sqlbean.to_8859_1(request.getParameter("mobile"));
String tel = sqlbean.to_8859_1(request.getParameter("tel"));
String depart = sqlbean.to_8859_1(request.getParameter("company"));
String ip = request.getRemoteAddr();
String pagesize = request.getParameter("pagesize");
//request.getParameter("admin")

Calendar now = Calendar.getInstance();
String sj = now.get(Calendar.YEAR)+"-"+(now.get(Calendar.MONTH)+1)+"-"+now.get(Calendar.DAY_OF_MONTH)+" "+now.get(Calendar.HOUR_OF_DAY)+":"+now.get(Calendar.MINUTE)+":"+now.get(Calendar.SECOND);
String sql = "select * from myuser where username='"+ username +"' or name='"+ name +"'";
sqlbean.executeQuery(sql);
if(sqlbean.next()){
out.println(sqlbean.showMsg("javascript:history.back()","账户已经存在!请重新选择名称!","注册提示"));
}else{

sql ="insert into myuser(username,pwd,email,part,wenti,daang,time,IP,phone,name,mobile,pagesize) values('"
+ username + "','"
+ password + "','"
+ email + "','"
+ depart + "','"
+ question + "','"
+ answer + "','"
+ sj + "','"
+ ip + "','"
+ tel + "','"
+ name + "','"
+ mobile + "','"
+ pagesize + "')";
sqlbean.executeUpdate(sql);
//out.println(sql);

sql ="select ID from myuser where username=\""+username+"\"";
sqlbean.executeQuery(sql);
if(sqlbean.next()){
sql ="insert into userinfo(userid,Uname,email,phone,mobile,Ltime) values('"
+ sqlbean.getString("ID") + "','"
+ username + "','"
+ email + "','"
+ tel + "','"
+ mobile + "','"
+ sj +"')";
sqlbean.executeUpdate(sql);
}

//
out.println(sqlbean.showMsg("javascript:window.close()","您已经成功申请帐户,等待管理员批准以后就可以登陆了!","系统提示"));
//out.println(sql);
}
sqlbean.close();
%>
...全文
103 点赞 收藏 5
写回复
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
weigame666 2004-10-11
说详细点好吗?我是个新手什么都不懂,谢谢了
回复
yxxcrtd 2004-10-11
出现????... 就是与数据库连接出现了问题,你再好好查查数据库中的字段是否匹配
回复
wandou999 2004-10-11
是不是没抛异常
回复
javafaq2004 2004-10-11
一个bean中数据库连接出错:
org.zhengmao.soft.sqlcon.(sqlcon.java:40)

也不知道我猜得对不对。
回复
newste 2004-10-10
看不大明白,你要表示的意思
回复
发动态
发帖子
Web 开发
创建于2007-09-28

7.9w+

社区成员

Java Web 开发
申请成为版主
社区公告
暂无公告