我在显示试图调用getCurrentlocation()类型中定义的函数的jsp页面时遇到异常Person.该函数${person.currentlocation}在jsp文件中调用.
type Exception report
message javax.el.ELException: Error reading 'currentlocation' on type **.person.Person
description The server encountered an internal error that prevented it from fulfilling this request.
exception
org.apache.jasper.JasperException: javax.el.ELException: Error reading 'currentlocation' on type **.person.Person
Run Code Online (Sandbox Code Playgroud)
我是jsp技术的新手.也许有人可以帮助我!
谢谢,本杰明
Bal*_*usC 19
这个特殊ELException是一个包装器异常.这通常只在调用getter方法本身抛出异常时抛出.ELException抛出这样的东西时会发生以下情况:
Object bean;
String property;
Method getter;
// ...
try {
getter.invoke(bean);
} catch (Exception e) {
String message = String.format("Error reading '%s' on type %s", property, bean.getClass().getName());
throw new ELException(message, e);
}
Run Code Online (Sandbox Code Playgroud)
你应该在stacktrace中进一步了解真正的根本原因.完整的堆栈跟踪通常仅在服务器日志中可用.真正的根本原因是堆栈跟踪的最底层异常.例如,下面的一个是由NullPointerExceptiongetter方法抛出引起的.
javax.el.ELException: Error reading 'currentlocation' on type **.person.Person
at ...
at ...
at ...
Caused by: java.lang.NullPointerException
at **.person.Person.getCurrentlocation(Person.java:42)
at ...
at ...
Run Code Online (Sandbox Code Playgroud)
有关真正根本原因(异常类型和行号)的信息应该为您提供足够的线索来解决问题.
同样,这通常不是EL的问题.这只是你自己的代码导致了这个问题.
| 归档时间: |
|
| 查看次数: |
20436 次 |
| 最近记录: |