当前位置: 技术问答>java相关
jsp 又来一问!
来源: 互联网 发布时间:2017-03-19
本文导语: 现在: package test; public class HelloWorld { String hello = "Hello World , I am fancy!"; public HelloWorld() { } public void setHello(String name) { hello=name; } public String getHello() { return hello; } } 可以在我定义的S...
现在:
package test;
public class HelloWorld {
String hello = "Hello World , I am fancy!";
public HelloWorld() {
}
public void setHello(String name) {
hello=name;
}
public String getHello() {
return hello;
}
}
可以在我定义的Server目录下运行了,可是:
Using a JavaBean
Using a JavaBean
I have a
Now I have a
package com.wrox.cars;
import java.io.Serializable;
public class CarBean implements Serializable{
private String make = "Ford";
public void setMake(String make) {
this.make = make;
}
public String getMake() {
return this.make;
}
public CarBean() {
}
private double cost = 10000.00;
private double taxRate = 17.5;
public double getPrice(double p) {
return (p + (p * (taxRate/100)));
}
public double getTaxedPrice() {
return getPrice(cost);
}
private void setTaxedPrice(double newTaxRate) {
}
}
却出错了:
javax.servlet.ServletException: sun/reflect/MethodAccessorImpl
java.lang.NoClassDefFoundError: sun/reflect/MethodAccessorImpl
就可以,怎么回事呢?
package test;
public class HelloWorld {
String hello = "Hello World , I am fancy!";
public HelloWorld() {
}
public void setHello(String name) {
hello=name;
}
public String getHello() {
return hello;
}
}
可以在我定义的Server目录下运行了,可是:
Using a JavaBean
Using a JavaBean
I have a
Now I have a
package com.wrox.cars;
import java.io.Serializable;
public class CarBean implements Serializable{
private String make = "Ford";
public void setMake(String make) {
this.make = make;
}
public String getMake() {
return this.make;
}
public CarBean() {
}
private double cost = 10000.00;
private double taxRate = 17.5;
public double getPrice(double p) {
return (p + (p * (taxRate/100)));
}
public double getTaxedPrice() {
return getPrice(cost);
}
private void setTaxedPrice(double newTaxRate) {
}
}
却出错了:
javax.servlet.ServletException: sun/reflect/MethodAccessorImpl
java.lang.NoClassDefFoundError: sun/reflect/MethodAccessorImpl
就可以,怎么回事呢?
|
-->
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。