标题:[求助]好奇怪的问题哦
取消只看楼主
fhy_happy365
Rank: 1
等 级:新手上路
帖 子:22
专家分:0
注 册:2007-4-24
 问题点数:0 回复次数:7 
[求助]好奇怪的问题哦
我那个表单验证页面,调试不出来呢!
郁闷死哦,代码是没问题的(教材上的源代码),
我估计 是我机器配置问题吧 烦死人呢 这搞不定
数据库都不好连了 请高手过来看看 什么问题啊
我把错误提示贴出来:


HTTP Status 500 - type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.
搜索更多相关主题的帖子: 源代码 数据库 The 教材 
2007-05-09 00:26
fhy_happy365
Rank: 1
等 级:新手上路
帖 子:22
专家分:0
注 册:2007-4-24
得分:0 

就一般的表单啊

2007-05-09 17:59
fhy_happy365
Rank: 1
等 级:新手上路
帖 子:22
专家分:0
注 册:2007-4-24
得分:0 

好的 我把全部的代码列出来

2007-05-09 22:17
fhy_happy365
Rank: 1
等 级:新手上路
帖 子:22
专家分:0
注 册:2007-4-24
得分:0 

index.jsp代码如下:
<%@ page contentType="text/html; charset=gb2312" %>
<html>
<body>
<center>
<form name="form1" method="post" action="login.jsp">
<TABLE border=0 cellPadding=0 cellSpacing=0>
<TR>
<TD colspan="3" align="center">请输入姓名密码:</TD>
</TR>
<TR>
<TD height=16 colspan="3"></TD>
</TR>
<TR>
<TD > 用户名:</TD>
<TD colspan="2"><INPUT name=username size="31" maxLength=50></TD>
</TR>
<TR>
<TD height=16 colspan="3"></TD>
</TR>
<TR>
<TD >密 码:</TD>
<TD colspan="2"><INPUT name=password size="31" maxLength=50></TD>
</TR>
<TR>
<TD height=16 colspan="3"></TD>
</TR>
<TR>
<TD >身 份:</TD>
<TD colspan="2">
<input name="select" type="radio" value="student" checked> 学生
<input type="radio" name="select" value="teacher">教师
<input type="radio" name="select" value="administrator">管理员</TD>
</TR>
<TR>
<TD height=16 colspan="3"></TD>
</TR>
<TR>
<TD height=13 colspan="3"></TD>
</TR>
<TR>
<TD ></TD>
<TD><input type="Submit" value="登录" ></TD>
<TD ><input type="Reset" value="复位"></TD>
</TR>
</TABLE>
</form>
</center>
</body>
</html>

login.jsp代码如下:

<%@ page contentType="text/html; charset=GB2312" %>
<%@ page import="java.sql.*" %>
<%@ page language="java" %>
<%@ page import="java.util.*" %>
<html>
<head>
<title>
身份验证
</title>
</head>
<body bgcolor="#ffffff">
<%
String user=request.getParameter("username");
String pwd=request.getParameter("password");
String select=request.getParameter("select");
if(user.equals("stu")&&pwd.equals("stu")&&select.equals("student"))
response.sendRedirect("stu.jsp");
if(user.equals("tea")&&pwd.equals("tea")&&select.equals("teacher"))
response.sendRedirect("tea.jsp");
if(user.equals("admin")&&pwd.equals("admin")&&select.equals("administrator"))
response.sendRedirect("admin.jsp");
else response.sendRedirect("error.jsp");
%>

</body>
</html>
stu.jsp代码如下:
<%@ page contentType="text/html; charset=GB2312" %>
<html>
<head>
<title>
stu
</title>
</head>
<body bgcolor="#ffffff">
<h1>
welcome to stu.jsp
</h1>
</body>
</html>
tea.jsp代码如下:
<%@ page contentType="text/html; charset=GB2312" %>
<html>
<head>
<title>
tea
</title>
</head>
<body bgcolor="#ffffff">
<h1>
welcome to tea.jsp
</h1>
</body>
</html>
admin.jsp代码如下:
<%@ page contentType="text/html; charset=GB2312" %>
<html>
<head>
<title>
admin
</title>
</head>
<body bgcolor="#ffffff">
<h1>
welcome to admin.jsp
</h1>
</body>
</html>
error.jsp代码如下
<%@ page contentType="text/html; charset=GB2312" %>
<html>
<head>
<title>
error
</title>
</head>
<body bgcolor="#ffffff">
<h1>
this is error page
</h1>
</body>
</html>



2007-05-09 22:22
fhy_happy365
Rank: 1
等 级:新手上路
帖 子:22
专家分:0
注 册:2007-4-24
得分:0 

把if换成else if还是报同样的错

2007-05-10 16:53
fhy_happy365
Rank: 1
等 级:新手上路
帖 子:22
专家分:0
注 册:2007-4-24
得分:0 
我估计是我的jsp环境配置出问题吧
2007-05-10 22:34
fhy_happy365
Rank: 1
等 级:新手上路
帖 子:22
专家分:0
注 册:2007-4-24
得分:0 
补充下我用的是Jbuilder2006+jdk1.6
不过没设环境变量的 不知道问题是出这里吗?
2007-05-10 22:50
fhy_happy365
Rank: 1
等 级:新手上路
帖 子:22
专家分:0
注 册:2007-4-24
得分:0 
请指点 这问题 出哪了?
java.lang.NullPointerException
at org.apache.jsp.login_jsp._jspService(org.apache.jsp.login_jsp:59)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
2007-5-11 22:01:18 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet debugjsp threw exception
java.lang.IllegalStateException
at org.apache.catalina.connector.ResponseFacade.sendRedirect(ResponseFacade.java:423)
at org.apache.jsp.login_jsp._jspService(org.apache.jsp.login_jsp:65)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
2007-05-11 22:13



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-137784-1-1.html




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

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