Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 1.7DR#1
-
Component/s: ICE-Components
-
Labels:None
-
Environment:Portal
Description
One of the methods of OutputChart makes a cast to ServletContext. This causes an exception when running in a portal environment. The method is getPath:
public String getPath() {
String folder = "/";
if (getFacesContext() != null &&
getFacesContext().getExternalContext() != null) {
if (DOMResponseWriter.isStreamWriting()) {
folder = "./web/chart/images";
} else {
folder =
((ServletContext) getFacesContext().getExternalContext()
.getContext()).getRealPath("/charts");
}
}
return folder;
}
I did a quick search of the component section of the repository and only found one other reference in InputFile but it might be legitimate as file upload is handled in a servlet context.
public String getPath() {
String folder = "/";
if (getFacesContext() != null &&
getFacesContext().getExternalContext() != null) {
if (DOMResponseWriter.isStreamWriting()) {
folder = "./web/chart/images";
} else {
folder =
((ServletContext) getFacesContext().getExternalContext()
.getContext()).getRealPath("/charts");
}
}
return folder;
}
I did a quick search of the component section of the repository and only found one other reference in InputFile but it might be legitimate as file upload is handled in a servlet context.
Issue Links
- is duplicated by
-
ICE-2261 OutputChart NPE in WebLogic 9.2
- Closed
Changed Fix Version to 1.7 DR#1.
As a tip Mircea suggested to look into a bit of refactoring of this method to use the ResourceRegistry instead of the ServletContext. Adnan, can you check to see if this is a feasible solution for ICEfaces 1.7 DR#1?