Struts Problem Report
Struts has detected an unhandled exception:
Messages:
File: net/shopxx/action/admin/CustomerAction.java
Line number: 95
Stacktraces
java.lang.NullPointerException
异常排除: public void setCustomer(Customer customer) {
this.customer = customer;
}
把setCustomer()方法名写成了setTrade(),所以出错了。 :cry:
Struts has detected an unhandled exception:
Messages:
File: net/shopxx/action/admin/CustomerAction.java
Line number: 95
Stacktraces
java.lang.NullPointerException
异常排除: public void setCustomer(Customer customer) {
this.customer = customer;
}
把setCustomer()方法名写成了setTrade(),所以出错了。 :cry:
本文详细解析了在Struts框架中出现的一个NullPointerException异常,并通过代码示例解释了问题的根源在于方法名错误导致的对象引用为null的情况。
976

被折叠的 条评论
为什么被折叠?



