在TestBooDBean2.jsp中通过setProperty设置bean0的属性值为aaa,为何getProperty获取的值为null?
代码入下:
TestBookDBean2.jsp:
<%@ page contentType= "text/html; charset=GBK " %>
<%@ page import= "java.util.*,bookstore.*; " %>
<html>
<head>
<title>
TestBookDBean2
</title>
</head>
<body bgcolor= "#ffffff ">
<jsp:useBean id= "book0 " scope= "session " class= "bookstore.BookBean "/>
<jsp:setProperty name= "book0 " property= "bookcocern " value= "aaa " />
<P> bookcocern的值为: <jsp:getProperty name= "book0 " property= "bookcocern "/>
</p>
</body>
</html>
BookBean.java:
package bookstore;
public class BookBean
{
private int id;
private String title;
private String author;
private String bookcocern;
private String publish_date;
private float price;
private int amount;
private String remark;
public BookBean()
{
}
public BookBean (int id,String title,String author,String boobkcocern,String publish_date,float price,int amount,String remark)
{
this.id=id;
this.title=title;
this.author=author;
this.bookcocern=bookcocern;
this.publish_date=publish_date;
this.price=price;
this.amount=amount;
this.remark=remark;
}
public int getId()
{
return id;
}
public String getTitle()
{
return title;
}
public String getAuthor()
{
return author;
}
public String getBookcocern()
{
return bookcocern;
}
public String getPublish_date()
{
return publish_date;