Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 2.0.0, 2.0.1, 2.0.2, 3.0, 3.0.1
-
Fix Version/s: 3.1.0.BETA1, 3.1
-
Component/s: ACE-Components
-
Labels:None
-
Environment:Portlet Environment
-
Assignee Priority:P2
-
Workaround Exists:Yes
-
Workaround Description:
Description
Recently I fixed a TCK failure in Liferay Faces Bridge regarding ExternalContext.getRequestContentType():
http://issues.liferay.com/browse/FACES-1226
The method used to return "text/html" but with the FACES-1226 it returns "multipart/form-data; ..." and this is changing the behavior of the following method in FileEntryResourceHandler:
{code}
@Override
public boolean isResourceRequest(FacesContext facesContext) {
ExternalContext externalContext = facesContext.getExternalContext();
String reqContentType = externalContext.getRequestContentType();
if ( (null == reqContentType) ||
!reqContentType.startsWith("multipart") ) {
return wrapped.isResourceRequest(facesContext);
}
{code}
Because of this, ace:fileEntry is causing the following stacktrace:
21:05:14,993 ERROR [ExceptionHandlerAjaxImpl:57]
java.lang.NullPointerException
at org.icefaces.apache.commons.fileupload.servlet.ServletFileUpload.isMultipartContent(ServletFileUpload.java:68)
at org.icefaces.ace.component.fileentry.FileEntryPhaseListener.beforePhase(FileEntryPhaseListener.java:114)
at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:228)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:99)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at com.liferay.faces.bridge.BridgePhaseResourceImpl.execute(BridgePhaseResourceImpl.java:109)
http://issues.liferay.com/browse/FACES-1226
The method used to return "text/html" but with the FACES-1226 it returns "multipart/form-data; ..." and this is changing the behavior of the following method in FileEntryResourceHandler:
{code}
@Override
public boolean isResourceRequest(FacesContext facesContext) {
ExternalContext externalContext = facesContext.getExternalContext();
String reqContentType = externalContext.getRequestContentType();
if ( (null == reqContentType) ||
!reqContentType.startsWith("multipart") ) {
return wrapped.isResourceRequest(facesContext);
}
{code}
Because of this, ace:fileEntry is causing the following stacktrace:
21:05:14,993 ERROR [ExceptionHandlerAjaxImpl:57]
java.lang.NullPointerException
at org.icefaces.apache.commons.fileupload.servlet.ServletFileUpload.isMultipartContent(ServletFileUpload.java:68)
at org.icefaces.ace.component.fileentry.FileEntryPhaseListener.beforePhase(FileEntryPhaseListener.java:114)
at com.sun.faces.lifecycle.Phase.handleBeforePhase(Phase.java:228)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:99)
at com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at com.liferay.faces.bridge.BridgePhaseResourceImpl.execute(BridgePhaseResourceImpl.java:109)
Activity
Neil Griffin
created issue -
Deryk Sinotte
made changes -
Field | Original Value | New Value |
---|---|---|
Salesforce Case | [] | |
Fix Version/s | 3.1 [ 10312 ] | |
Assignee Priority | P2 | |
Assignee | Deryk Sinotte [ deryk.sinotte ] |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #29093 | Thu May 17 12:11:40 MDT 2012 | deryk.sinotte | |
Files Changed | ||||
MODIFY
/icefaces3/trunk/icefaces/ace/component/src/org/icefaces/apache/commons/fileupload/servlet/ServletFileUpload.java
|
Deryk Sinotte
made changes -
Status | Open [ 1 ] | Resolved [ 5 ] |
Resolution | Fixed [ 1 ] |
Ken Fyten
made changes -
Fix Version/s | 3.1.0.BETA1 [ 10335 ] |
Ken Fyten
made changes -
Status | Resolved [ 5 ] | Closed [ 6 ] |
Checked in an update to ServletFileUpload.isMultipartContent to check if the getMethod returns a null value. As per
ICE-6371, the getMethod() call doesn't exist in the ExternalContext API and is only available on a subset of the various types of requests that portlets can provide. This won't affect PortletFaces Bridge and will allow Liferay Faces Bridge to work without requiring the special handling for ICEfaces.