Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: EE-2.0.0.GA, 3.0
-
Fix Version/s: EE-2.0.0.GA, 2.0.2
-
Component/s: Framework
-
Labels:None
-
Environment:Liferay 6.0.6 + Tomcat 6.0.29 + PortletFaces Bridge 2.0.0-SNAPSHOT (April 7th, 2011)
Description
Here's the patch:
Index: core/src/main/java/org/icefaces/impl/application/DeltaSubmitParametersPropagation.java
===================================================================
--- core/src/main/java/org/icefaces/impl/application/DeltaSubmitParametersPropagation.java (revision 24358)
+++ core/src/main/java/org/icefaces/impl/application/DeltaSubmitParametersPropagation.java (working copy)
@@ -51,7 +51,7 @@
public void handleNavigation(FacesContext context, String fromAction, String outcome) {
NavigationCase navigationCase = getNavigationCase(context, fromAction, outcome);
- if (navigationCase.isRedirect()) {
+ if ((navigationCase != null) && (navigationCase.isRedirect())) {
handler.handleNavigation(context, fromAction, outcome);
} else {
UIViewRoot viewRoot = context.getViewRoot();
@@ -63,7 +63,13 @@
viewAttributes.put(DeltaSubmitPhaseListener.PreviousParameters, idToPreviousParametersMapping);
}
for (UIForm form: forms) {
- idToPreviousParametersMapping.put(form.getId(), new HashMap((Map) form.getAttributes().get(DeltaSubmitPhaseListener.PreviousParameters)));
+ Map<String, Object> formAttributes = form.getAttributes();
+ if (formAttributes != null) {
+ Map previousParametersMap = (Map) formAttributes.get(DeltaSubmitPhaseListener.PreviousParameters);
+ if (previousParametersMap != null) {
+ idToPreviousParametersMapping.put(form.getId(), new HashMap(previousParametersMap));
+ }
+ }
}
handler.handleNavigation(context, fromAction, outcome);
//propagate previously calculated submit parameters
Index: core/src/main/java/org/icefaces/impl/application/DeltaSubmitParametersPropagation.java
===================================================================
--- core/src/main/java/org/icefaces/impl/application/DeltaSubmitParametersPropagation.java (revision 24358)
+++ core/src/main/java/org/icefaces/impl/application/DeltaSubmitParametersPropagation.java (working copy)
@@ -51,7 +51,7 @@
public void handleNavigation(FacesContext context, String fromAction, String outcome) {
NavigationCase navigationCase = getNavigationCase(context, fromAction, outcome);
- if (navigationCase.isRedirect()) {
+ if ((navigationCase != null) && (navigationCase.isRedirect())) {
handler.handleNavigation(context, fromAction, outcome);
} else {
UIViewRoot viewRoot = context.getViewRoot();
@@ -63,7 +63,13 @@
viewAttributes.put(DeltaSubmitPhaseListener.PreviousParameters, idToPreviousParametersMapping);
}
for (UIForm form: forms) {
- idToPreviousParametersMapping.put(form.getId(), new HashMap((Map) form.getAttributes().get(DeltaSubmitPhaseListener.PreviousParameters)));
+ Map<String, Object> formAttributes = form.getAttributes();
+ if (formAttributes != null) {
+ Map previousParametersMap = (Map) formAttributes.get(DeltaSubmitPhaseListener.PreviousParameters);
+ if (previousParametersMap != null) {
+ idToPreviousParametersMapping.put(form.getId(), new HashMap(previousParametersMap));
+ }
+ }
}
handler.handleNavigation(context, fromAction, outcome);
//propagate previously calculated submit parameters
Mircea,
Please review Neil's patch and provide feedback/adjustments/etc. I've applied the patch locally and run some tests on our ACE components in Liferay 5 and this clears up a bunch of NullPointerExceptions we were seeing when running the ACE Showcase Portlets demo.