主题:这样 jsp+bean怎么回出错,跪求解答
我在C:\Tomcat 5.0\webapps\mytest下建立了一个carPage.jsp页面。
在C:\Tomcat 5.0\webapps\mytest\WEB-INF\classes\com\wrox\cars下有。〉javac com\wrox\cars\CarBean.java 编译成功为CarBean.class,怎么运行http://localhost:8080/mytest/carPage.jsp老出错。
jsp的bean还有特别的。请教大家。望回复,急盼。
carPage.jsp文件为:
<html>
<head>
<title> Using a JavaBean </title>
</head>
<body>
<h2>Using a javaBean001</h2>
<jsp:useBean id="myCar" class="com.wrox.cars.CarBean" />
i hava a <jsp:getProperty name="myCar" property="make" />
</body>
</html>
CarBean.java 为:
package com.wrox.cars;
import java.io.Serializable;
public class CarBean implements Serializable{
public CarBean(){
}
private String make="Ford";
public String getMode() {
return make;
}
public void setMake(String make){
this.make=make;
}
}
在C:\Tomcat 5.0\webapps\mytest\WEB-INF\classes\com\wrox\cars下有。〉javac com\wrox\cars\CarBean.java 编译成功为CarBean.class,怎么运行http://localhost:8080/mytest/carPage.jsp老出错。
jsp的bean还有特别的。请教大家。望回复,急盼。
carPage.jsp文件为:
<html>
<head>
<title> Using a JavaBean </title>
</head>
<body>
<h2>Using a javaBean001</h2>
<jsp:useBean id="myCar" class="com.wrox.cars.CarBean" />
i hava a <jsp:getProperty name="myCar" property="make" />
</body>
</html>
CarBean.java 为:
package com.wrox.cars;
import java.io.Serializable;
public class CarBean implements Serializable{
public CarBean(){
}
private String make="Ford";
public String getMode() {
return make;
}
public void setMake(String make){
this.make=make;
}
}