我是初学者,写了一个BEAN,和一个JSP文件,内容如下。
jsp
<html>
<head><title>hello world</title></head>
<jsp:useBean id="HW" scope="request" class="HelloWorld"/>
<center>
修改前:<%= HW.getString() %>
<%HW.setString("hello everybody!");%>
修改后:<%= HW.getString() %>
</center>
</html>
JAVA文件
package HelloWorld;
public class HelloWorld {
  String s;
  public HelloWorld {
    this.s = "hello world";
  }
  public void setString(String string) {
    this.s = string;
  }
  public String getString() {
    return(this.s);
  }
}
jsp文件放在
F:\resin-pro-3.1.0\webapps\ROOT下
class文件放在
F:\resin-pro-3.1.0\webapps\ROOT\WEB-INF\classes下
但是运行是显示
500 Servlet Exception
HelloWorld (wrong name: HelloWorld/HelloWorld)
请高手解释一下,谢谢大家,急啊。