我写了一个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