QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1115|回复: 1

请教一个问题:cannot resolve symbol

[复制链接]
发表于 2004-4-12 18:42:35 | 显示全部楼层 |阅读模式
我写了一个bean叫HelloWorld放在主目录的WEB-INF下,通过javac已经可以编译成.class。然后我在主目录中用一个jsp文件,调用他
<jsp:useBean id="circle" class="HelloWorld" scope="page">
</jsp:useBean>
<% circle.setRadius(100);%>
<%=circle.getRadius()%>
结果出现如下错误:
An error occurred at line: 8 in the jsp file: /index.jsp
Generated servlet error:
    [javac] Compiling 1 source file
D:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\index_jsp.java:43: cannot resolve symbol
symbol : class HelloWorld
location: class org.apache.jsp.index_jsp
      HelloWorld circle = null;
  ^
An error occurred at line: 8 in the jsp file: /index.jsp
Generated servlet error:
D:\Program Files\Apache Software Foundation\Tomcat 5.0\work\Catalina\localhost\_\org\apache\jsp\index_jsp.java:45: cannot resolve symbol
symbol : class HelloWorld
location: class org.apache.jsp.index_jsp
        circle = (HelloWorld) pageContext.getAttribute("circle", PageContext.PAGE_SCOPE);
   An error occurred at line: 8 in the jsp file: /index.jsp


请问这是什么原因,如何解决?
发表于 2004-4-12 22:04:40 | 显示全部楼层
HelloWorld.class 应该放在 WEB-INF\classes 目录下
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-11-16 05:04 , Processed in 0.037603 second(s), 16 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表