求救,如何修改
<%@ page contentType="text/html;charset=GB2312" %><%@ page import="user.file.test"%>
<jsp:useBean id="test" class="user.file.test" scope="session"/>
<HTML><BODY bgcolor=green><Font size=4>
<FORM action="test.jsp" method="post">
<table boder=1>
<tr><th>姓名</th>
<th>学号</th>
<th>班级</th>
<th>成绩</th>
</tr>
<tr><td><jsp:getProperty name="test" property="number"/></td>
<td><jsp:getProperty name="test" property="name"/></td>
<td><jsp:getProperty name="test" property="banji"/></td>
<td><jsp:getProperty name="test" property="score"/>
</tr>
</FORM></FONT></BODY></HTML>
出现这个问题
org.apache.jasper.JasperException: Cannot find a method to read property 'number' in a bean of type 'user.file.test'
在java里面我已经有定义number,name,那几个变量,并且是在test.jsp这个界面是用得了的,只是链接到这个页面就不行了,怎么办? --------------------编程问答-------------------- number属性是否是public的? --------------------编程问答-------------------- --------------------编程问答-------------------- 应该还有对应的public的get,set方法。。。 --------------------编程问答-------------------- 要想通过<s:property>获取属性值,在action中必须定义变量的setter和getter --------------------编程问答--------------------
--------------------编程问答-------------------- 这是要在java里面改吗?
public String getNumber() {
return this.number;
}
--------------------编程问答-------------------- 谢谢,问题解决了!
补充:Java , Web 开发