Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: 1.8.2-EE-GA_P02
-
Fix Version/s: EE-1.8.2.GA_P04
-
Component/s: Framework
-
Labels:None
-
Environment:Spring 2.5.6, Spring Web Flow 2.0.6
-
ICEsoft Forum Reference:
Description
Activity
Ted Goddard
created issue -
Tyler Johnson
made changes -
Field | Original Value | New Value |
---|---|---|
Summary | CLONE -ice:message not displayed when using Spring Web Flow | CLONE - ice:messages not displayed when using Spring Web Flow |
Environment | ICEfaces 1.7.2, SWF 2.0.3 | Spring 2.5.6, Spring Web Flow 2.0.6 |
Salesforce Case | [5007000000F4WUG] | |
Affects Version/s | 1.8.2-EE-GA_P02 [ 10226 ] | |
Affects Version/s | 1.7.2 [ 10130 ] | |
Description |
After some more debugging on the problem I have noticed that the BridgeFacesContext never hold any messages because they are added to the FlowFacesContext which is the Spring Web Flow version of the FacesContext. All phases of the JSF lifecycle except for RENDER_RESPONSE is handled by the FlowFacesContext. When entering the RENDER_RESPONCE phase the FlowFacesContext is unwrapped to a BridgeFacesContext by the following code: Code: public static FacesContext unwrap(FacesContext facesContext) { if (facesContext instanceof BridgeFacesContext) { return facesContext; } FacesContext result = facesContext; try { Method delegateMethod = facesContext.getClass() .getDeclaredMethod("getDelegate", new Class[]{}); delegateMethod.setAccessible(true); Object delegate = delegateMethod .invoke(facesContext, (Object[]) null); if (delegate instanceof BridgeFacesContext) { result = (FacesContext) delegate; if (log.isDebugEnabled()) { log.debug("BridgeFacesContext delegate of " + facesContext); } } } catch (Exception e) { } return result; } The FacesMessages that were added to the FlowFacesContext are never passed on to the BridgeFacesContext. I therefore made a small change to the unwrap method: Code: public static FacesContext unwrap(FacesContext facesContext) { if (facesContext instanceof BridgeFacesContext) { return facesContext; } FacesContext result = facesContext; try { Method delegateMethod = facesContext.getClass() .getDeclaredMethod("getDelegate", new Class[]{}); delegateMethod.setAccessible(true); Object delegate = delegateMethod .invoke(facesContext, (Object[]) null); if (delegate instanceof BridgeFacesContext) { result = (FacesContext) delegate; //patch start : getting the faces messages from the FlowFacesContext Iterator clientIdIterator = facesContext.getClientIdsWithMessages(); while(clientIdIterator.hasNext()){ String clientId = (String)clientIdIterator.next(); Iterator facesMessagesForClientId = facesContext.getMessages(clientId); while(facesMessagesForClientId.hasNext()){ FacesMessage message = (FacesMessage)facesMessagesForClientId.next(); result.addMessage(clientId, message); } } // patch end. if (log.isDebugEnabled()) { log.debug("BridgeFacesContext delegate of " + facesContext); } } } catch (Exception e) { } return result; } |
The fix for result.addMessage("", message); to result.addMessage(null, message); |
Reporter | Ted Goddard [ ted.goddard ] | Tyler Johnson [ tyler.johnson ] |
Tyler Johnson
made changes -
Summary | CLONE - ice:messages not displayed when using Spring Web Flow | ice:messages not displayed when using Spring Web Flow |
Description |
The fix for result.addMessage("", message); to result.addMessage(null, message); |
The fix for result.addMessage("", message); to result.addMessage(null, message); |
Tyler Johnson
made changes -
Fix Version/s | 1.8DR#2 [ 10142 ] | |
Fix Version/s | 1.8 [ 10161 ] |
Ken Fyten
made changes -
Fix Version/s | EE-2.0.0.GA_P01 [ 10271 ] | |
Fix Version/s | 2.1 [ 10241 ] | |
Assignee Priority | P1 |
Greg Dick
made changes -
Status | Open [ 1 ] | Resolved [ 5 ] |
Fix Version/s | EE-1.8.2.GA_P03 [ 10251 ] | |
Fix Version/s | EE-2.0.0.GA_P01 [ 10271 ] | |
Fix Version/s | 2.1 [ 10241 ] | |
Resolution | Fixed [ 1 ] |
Ken Fyten
made changes -
Resolution | Fixed [ 1 ] | |
Status | Resolved [ 5 ] | Reopened [ 4 ] |
Ken Fyten
made changes -
Fix Version/s | EE-1.8.2.GA_P04 [ 10280 ] | |
Fix Version/s | EE-1.8.2.GA_P03 [ 10251 ] |
Repository | Revision | Date | User | Message |
ICEsoft Public SVN Repository | #28622 | Tue Apr 03 11:10:11 MDT 2012 | greg.dick | |
Files Changed | ||||
MODIFY
/icefaces/trunk/icefaces/core/src/com/icesoft/faces/context/BridgeFacesContext.java
|
Greg Dick
made changes -
Status | Reopened [ 4 ] | Resolved [ 5 ] |
Resolution | Fixed [ 1 ] |
Ken Fyten
made changes -
Status | Resolved [ 5 ] | Closed [ 6 ] |
Assignee Priority | P1 |
The suggested code change looks correct. The facesMessagesWithNoId iterator should hold messages with no id from the FacesContext.getMessages(null) call. From the javadoc, propagating these with result.addMessage(null, message); is the correct call.