eclipse-ee4j / eclipse-ee4j/wasp
a ClassCastException is thrown when EL is used in conjunction with a custom PageContext wrapper
- Dominant language
- Java
- Stars
- 8
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
The following method in org.apache.jasper.runtime.PageContextImpl
```
private static ExpressionFactory getExpressionFactory(
PageContext pageContext) {
PageContextImpl pc =
(PageContextImpl) JspContextWrapper.getRootPageContext(pageContext);
return pc.getJspApplicationContext().getExpressionFactory();
}
```
results in the exception.
However, it's possible to accomplish the exact same thing in a compliant way, without a cast, using:
```
JspApplicationContext jspApplicationContext =
JspFactory.getDefaultFactory().getJspApplicationContext(
pageContext.getServletContext());
return jspApplicationContext.getExpressionFactory();
```
#### Environment
any
#### Affected Versions
[current]
Contributor guide
Assessment
This issue has not been assessed yet.