javaBean 不能运行
新学java,javaBean不能运行 帮忙看看的
package com.lyq.bean;
/**
* 商品对象
* @author Li YongQiang
*/
public class Produce {
// 商品名称
private String name = "电吉他";
// 商品价格
private double price = 1880.5;
// 数量
private int count = 100;
// 出厂地址
private String factoryAdd = "吉林省长春市xxx琴行";
public String getName() {
return name;
}
public double getPrice() {
return price;
}
public int getCount() {
return count;
}
public String getFactoryAdd() {
return factoryAdd;
}
}
<%@ page language="java" contentType="text/html; charset=GB18030"
pageEncoding="GB18030"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB18030">
<title>Insert title here</title>
</head>
<body>
<jsp:useBean id="produce" class="com.lyq.bean.Produce"></jsp:useBean>
<div>
<ul>
<li>
商品名称:<jsp:getProperty property="name" name="produce"/>
</li>
<li>
价格:<jsp:getProperty property="price" name="produce"/>
</li>
<li>
数量:<jsp:getProperty property="count" name="produce"/>
</li>
<li>
厂址:<jsp:getProperty property="factoryAdd" name="produce"/>
</li>
</ul>
</div>
</body>
</html>
错误:
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: /index.jsp(10,1) The value for the useBean class attribute com.lyq.bean.Produce is invalid.
org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:40)
org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:407)
org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:148)
org.apache.jasper.compiler.Generator$GenerateVisitor.visit(Generator.java:1231)
org.apache.jasper.compiler.Node$UseBean.accept(Node.java:1178)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2411)
org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2417)
org.apache.jasper.compiler.Node$Root.accept(Node.java:495)
org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2361)
org.apache.jasper.compiler.Generator.generate(Generator.java:3442)
org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:231)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:347)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
org.apache.jasper.JspCompilationContext.compile(JspCompilatio