| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 874 人关注过本帖
标题:怎么解决这个问题
取消只看楼主 加入收藏
你的样子
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2006-12-19
收藏
 问题点数:0 回复次数:3 
怎么解决这个问题

大家帮我看看问题怎么解决啊,初学,多谢!
type Exception report

message

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

exception

org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:372)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:103)


root cause

java.lang.NullPointerException
org.apache.jsp.TestServer1_jsp._jspService(TestServer1_jsp.java:73)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:103)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:103)


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

搜索更多相关主题的帖子: message request server report 
2007-06-11 15:21
你的样子
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2006-12-19
收藏
得分:0 
回复:(你的样子)怎么解决这个问题
<%@ page contentType="text/html;charset=gb2312"%>
<!-导入程序所需的相应的包packages,一般jsp中进行数据库操作都可以引入这些类包->
<%@ page info="database handler"%>
<%@ page import="java.io.*"%>
<%@ page import="java.util.*"%>
<%@ page import="java.sql.*"%>
<%@ page import="javax.servlet.*"%>
<%@ page import="javax.servlet.http.*"%>
<html>
<head>
<title>信息查询</title>
</head>
<body>
<% String kind="";
String keyword="";
request.setCharacterEncoding("GB2312");
kind=request.getParameter("kind");
keyword=request.getParameter("keyword");%>
<% String attribute="";
if(kind.equals("职工号")) attribute="职工号";
else if(kind.equals("姓名")) attribute="姓名";
else if(kind.equals("性别")) attribute="性别";
else if(kind.equals("参加工作")) attribute="参加工作";%>
<% try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver").newInstance();
String url="jdbc:odbc:employees";
Connection conn=DriverManager.getConnection(url,"","");
Statement smt=conn.createStatement();
String sql="Select * from worker where "+attribute+" like'"+keyword+"'";
ResultSet rs=smt.executeQuery(sql);
out.print("<TABLE BORDER>");
out.print("<CAPTION><H2>本次浏览数据库的结果如下</CAPTION>");
out.print("<TR align=center>");%>
<%
out.print("<TD>职工号</TD><TD>姓名</TD><TD>性别</TD><TD>参加工作</TD></TR>");
while(rs.next()){
out.print("<TR>");
for(int i=1;i<=rs.getMetaData().getColumnCount();i++){
out.print("<TD>");
out.print(rs.getObject(i)+"\t");
out.print("</TD>");}
out.print("<TD><A href=http://>请点击这里</A></TD>");
out.println("</TR>");}
out.print("</TABLE>");
rs.close();
smt.close();
conn.close();
}catch(Exception e){out.println(e.toString());}
%>
</body>
</html>
2007-06-11 20:01
你的样子
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2006-12-19
收藏
得分:0 
我明白了!多谢!
2007-06-12 13:23
你的样子
Rank: 1
等 级:新手上路
帖 子:7
专家分:0
注 册:2006-12-19
收藏
得分:0 

我找到了TestServer1_jsp 但又出现了问题!
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: 24 in the jsp file: /textsql.jsp
Generated servlet error:
C:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\textsql_jsp.java:78: "try" ??? "catch" ? "finally"
try{
^
1 ??

org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:332)
org.apache.jasper.compiler.Compiler.generateClass(Compiler.java:437)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:497)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:476)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:464)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:103)


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

2007-06-13 15:17
快速回复:怎么解决这个问题
数据加载中...
 
   



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

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