当前位置: 技术问答>java相关
tomcat4.0中,一个包含class的jsp文件为何出错?
来源: 互联网 发布时间:2015-07-02
本文导语: CarBean.java如下: package com.wrox.cars; import java.io.Serializable; public class CarBean implements Serializable { public CarBean() { } private String make="ford"; public String getMake() { return make; } public void setMake(String make) { this....
CarBean.java如下:
package com.wrox.cars;
import java.io.Serializable;
public class CarBean implements Serializable
{
public CarBean()
{
}
private String make="ford";
public String getMake()
{
return make;
}
public void setMake(String make)
{
this.make = make;
}
}
编绎成CarBean.class。
car.jsp如下:
using a carbean
using a javabean
I own a
now i own a
出错提示:
org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
An error occurred at line: 8 in the jsp file: /test/car.jsp
Generated servlet error:
D:Tomcat 4.0workStandalonelocalhost_testcar$jsp.java:58: Class com.wrox.cars.CarBean not found.
com.wrox.cars.CarBean myCar = new com.wrox.cars.CarBean();
^
An error occurred at line: 8 in the jsp file: /test/car.jsp
Generated servlet error:
D:Tomcat 4.0workStandalonelocalhost_testcar$jsp.java:58: Class com.wrox.cars.CarBean not found.
com.wrox.cars.CarBean myCar = new com.wrox.cars.CarBean();
package com.wrox.cars;
import java.io.Serializable;
public class CarBean implements Serializable
{
public CarBean()
{
}
private String make="ford";
public String getMake()
{
return make;
}
public void setMake(String make)
{
this.make = make;
}
}
编绎成CarBean.class。
car.jsp如下:
using a carbean
using a javabean
I own a
now i own a
出错提示:
org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
An error occurred at line: 8 in the jsp file: /test/car.jsp
Generated servlet error:
D:Tomcat 4.0workStandalonelocalhost_testcar$jsp.java:58: Class com.wrox.cars.CarBean not found.
com.wrox.cars.CarBean myCar = new com.wrox.cars.CarBean();
^
An error occurred at line: 8 in the jsp file: /test/car.jsp
Generated servlet error:
D:Tomcat 4.0workStandalonelocalhost_testcar$jsp.java:58: Class com.wrox.cars.CarBean not found.
com.wrox.cars.CarBean myCar = new com.wrox.cars.CarBean();
|
ligar(ligar):
不要误导群众,当然可以这样写jsp。
兄弟,是你的class找不到。看看tomcat的例子。
不要误导群众,当然可以这样写jsp。
兄弟,是你的class找不到。看看tomcat的例子。