我是初学者,写了一个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)
请高手解释一下,谢谢大家,急啊。
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)
请高手解释一下,谢谢大家,急啊。
解决方案 »
- 在线等。response.sendRedirect request.getParameter 乱码问题。
- org.springframework.beans.factory.BeanCreationException错误?
- Servler的传值问题`
- 小妹不才,想问个 javascript 的小问题! 急死人了!!!
- 用response.encodeRedirectURL编码且跳转后,用什么解码?
- tomcat5配置数据源问题,在线等待
- java客户端调用服务器标签打印机问题
- 出错消息: [JSP 1.0 Processor] 报告了一个错误
- 请教如何让从数据库读取的数据进行分列分页显示?
- 提交带多个文件的表单,还有其他非文件的输入框,怎么在servlet中处理?
- 求JAVA操作EXCEL的实例
- 关于分页,我的想法
500 Servlet Exception
HelloWorld (wrong name: HelloWorld/HelloWorld)
请问是怎么回事?
包名在哪儿?