刚学jsp,javabean的问题,望各位大虾门帮忙看看。
一个简单的javabean例子,可是实现不了。
//javabean:
//tax.TaxRate
package tax;
public class TaxRate{
double Rate=0;
public TaxRate(){
}
public void setRate(double rateValue){
this.Rate=rateValue;
}
public double getRate(){
return this.Rate;
}
}
调用页面:bean.jsp
<HTML>
<BODY>
<%@ page language="java" %>
<jsp:useBean id="taxbean" scope="application" class="tax.TaxRate" />
<% taxbean.setRate(3);
%>
<b> 使用方法</b> <p>
税率:<jsp:getProperty name="taxbean" property="Rate"/>
</BODY>
</HTML>
java源程序在\webapps\examples\WEB-INF\class中编译,
bean.jsp在\webapps\examples中。
输入http://localhost:8080/examples/bean.jsp时,出现:
Error: 500
Location: /examples/bean.jsp
Internal Servlet Error:
org.apache.jasper.JasperException: Cannot find any information on property 'Rate' in a bean of type 'tax.TaxRate'
at org.apache.jasper.runtime.JspRuntimeLibrary.getReadMethod(JspRuntimeLibrary.java:619)
at org.apache.jasper.compiler.GetPropertyGenerator.generate(GetPropertyGenerator.java:101)
...
...
...
怎么会这样的,我刚学jsp,是我设置的有问题吗?