| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1852 人关注过本帖
标题:JSP异常问题
只看楼主 加入收藏
D13968616110
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2019-5-9
结帖率:0
收藏
已结贴  问题点数:20 回复次数:2 
JSP异常问题
HTTP Status 500 - An exception occurred processing JSP page /chkuser.jsp at line 10


type Exception report

message An exception occurred processing JSP page /chkuser.jsp at line 10

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

exception
org.apache.jasper.JasperException: An exception occurred processing JSP page /chkuser.jsp at line 10

7:
8:      ResultSet rst=chk.executeQuery("select * from vip_info where vip_id='"+vip_id+"' and vip_password = '"+password+"'");
9: int yes=0;
10: if(rst.next())
11: {
12:     session.setAttribute("vip_id",vip_id);
13:      yes=1;


Stacktrace:
    org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:568)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:470)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)



root cause
java.lang.NullPointerException
    org.apache.jsp.chkuser_jsp._jspService(chkuser_jsp.java:81)
    org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:395)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)



note The full stack trace of the root cause is available in the Apache Tomcat/7.0.56 logs.
搜索更多相关主题的帖子: JSP apache servlet java service 
2019-05-09 08:09
GrayJerry
Rank: 5Rank: 5
等 级:贵宾
威 望:14
帖 子:75
专家分:310
注 册:2015-10-20
收藏
得分:10 
ResultSet rst=chk.executeQuery("select * from vip_info where vip_id='"+vip_id+"' and vip_password = '"+password+"'");
这句话查询出来的结果 rst 为空。
if(rst.next())
这句话需要判断 rst是否为空,修改后的代码如下:
if(rst != null && rst.next())
2019-05-11 10:03
零零七。
Rank: 2
等 级:论坛游民
帖 子:3
专家分:10
注 册:2019-5-15
收藏
得分:10 
感觉学到了很多
2019-05-15 11:39
快速回复:JSP异常问题
数据加载中...
 
   



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

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