Why not find a bean property?

Category: Web Develop
 
rhtangyong
2012-01-01 11:28:34

Sponsored Links
win2000, Tomcat4.1 I experiment the following examples:
<HTML>
<BODY>
<% @ page ; language = "java" import = "tax.TaxRate"%>
<jsp: useBean id = "taxbean" scope = "application" class = "tax.TaxRate" />
<% taxbean.setProduct ("A002");
taxbean. setRate (17);
%>
Usage 1: <p>
Products : <% = taxbean.getProduct ()%> <br>
rate: <% = taxbean.getRate () %>
<p>
<% taxbean.setProduct ("A003");
taxbean.setRate (3);
%>
<b> use Method 2: < ;/ b> <p>
Products: <jsp:getProperty name="taxbean" property="Product" />
<br>
rate: <jsp: getProperty name = "taxbean" property = "Rate" / >
</BODY>
</HTML>
-------------- -----------------------------
package tax;
public class ; TaxRate {
String Product;
double Rate;
public TaxRate () {
this.Product = "A001";
this.Rate = 5;
;}
public void setProduct (String ProductName) {
this.Product = ProductName;
;}
public String getProduct () {
return (this.Product);
}
public void setRate (double rateValue) {
this.Rate = rateValue;
}
public double getRate () {
return (this.Rate);
}
}
-------------------------- -----------------------------------
under the class files in the WEB-INF/classes This should be no problem
run is the following error message:
HTTP Status 500 -

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException: Cannot find any information on property 'Product' in a bean of type 'tax . TaxRate '

Sponsored Links

hao00lai
2012-01-01 11:39:50
Java is case-sensitive, the attributes of the bean you all lowercase, the property is also in html all lowercase, try,
such cases I met once.
zlj7222
2012-01-01 11:44:25
Try the Product to product
qq131421qqa
2012-01-01 12:01:52
have not seen, to help you UP.
Domain and server ip had changed since 8/23/2013. Suspend the user registration and posts for program maintenance.