我刚用JBULIDER不久,为什么JBULIDER不允许使用我自己创建的BEAN呢?

xuanleigg 2001-10-15 10:29:22
我刚用JBULIDER不久,为什么JBULIDER不允许使用我自己创建的BEAN呢?
运行后报ERROR500错误

jsp1.jsp内容如下:
<%@ page language="java" import="java.sql.*"%>
<%@ page contentType="text/html; charset=GBK" %>
<html>
<head>
<title>
hellobean
</title>
</head>
<body>
<jsp:useBean id="workM" scope="page" class="zcw.ZcwConn2"/>
<%String rs=workM.changeQuery("aa");
out.println(rs);
%>
</body>
</html>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ZcwConn的代码如下:
package zcw;

import java.awt.*;
//import javax.swing.JPanel;

public class ZcwConn2{
String rs;
public ZcwConn2() {
try {
rs="a";
}
catch(Exception ex) {
System.err.println("zcwconn:"+ex.getMessage());
}
}
public String changeQuery(String sql){
try{
rs=sql;
}
catch(Exception be){
System.err.println("be.executeQuery:"+be.getMessage());
}
return rs;
}
}
编译没问题,但在运行后报ERROR500错误
Error: 500
Location: /examples/jsp/hellobean.jsp
Internal Servlet Error:

javax.servlet.ServletException
at org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:459)
at jsp._0002fjsp_0002fhellobean_0002ejsphellobean_jsp_2._jspService(_0002fjsp_0002fhellobean_0002ejsphellobean_jsp_2.java:107)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:177)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:318)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:391)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)

单独运行CLASS文件也是这样的报错!
请赐教,谢谢。
...全文
38 点赞 收藏 3
写回复
3 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
xuanleigg 2001-10-15
????????
回复
xuanleigg 2001-10-15
u
p






回复
xuanleigg 2001-10-15
up
回复
相关推荐
发帖
Web 开发
创建于2007-09-28

8.0w+

社区成员

Java Web 开发
申请成为版主
帖子事件
创建了帖子
2001-10-15 10:29
社区公告
暂无公告