tomcat一个奇怪的问题(JBEAN)

来源:百度知道 编辑:UC知道 时间:2024/05/24 12:59:31
调试好TOMCAT环境 JSP,SERVLET均运行无误.
但调试JBEAN的时候很奇怪
一,
(1)
JSP文件中引用类:
<%@ page language="java" import="bean.Counter" %>

但是Counter.class如果放在C:\TOMCAT\myapp\WEB-INF\classes\bean下
就会出现错误
type Exception report

message

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

org.apache.jasper.JasperException: Unable to compile class for JSP

(2)
但把Counter.class放在C:\TOMCAT\myapp\WEB-INF\classes\下,虽然有时会正常运行,但偶尔也会出现上面同样的错误
(3)
如果将Counter.class同时分别放在C:\TOMCAT\myapp\WEB-INF\classes\和
C:\TOMCAT\myapp\WEB-INF\classes\bean下,
则运行无错误,一切正常,一次错误也没有
二,
JSP文件改为
<%@ page language="java" import="Counter" %>
又会出现上述一,(2)情形的有时正常有时出现错误的情形

type Exception report

message

我觉得是你的Counter.java编写或编译有问题
还有引用方法使用
<jsp:useBean id="cnt" scope="request" class="bean.Counter" />

http://www.xieker.com/navipal/tagDetail.do?tagId=1450&tagName=Java