Details
-
Type: Bug
-
Status: Open
-
Priority: Major
-
Resolution: Unresolved
-
Affects Version/s: 3.3
-
Fix Version/s: None
-
Component/s: ICE-Components
-
Labels:None
-
Environment:Windows 7
GlassFish 3.1.2.2
Liferay 6.1 CE
-
ICEsoft Forum Reference:
Description
Porlet X -> Initial view A -> User selects option -> Selected view B -> User presses "Cancel" -> Returned to view A
If the "immediate" attribute on the "Cancel" button in view B is left out (or set to false), this is what shows up in the Chrome network monitor (assuming I fill in data that satisfies the validation requirements):
http://localhost:8080/home?p_p_id=session_manager_WAR_Gateway&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_count=1&_session_manager_WAR_Gateway__jsfBridgeAjax=true&_session_manager_WAR_Gateway__facesViewIdResource=%2Fsession%2Flogin.xhtml
If the "immediate" attribute is set to "true", this is what shows up:
http://localhost:8080/home?p_p_id=session_manager_WAR_Gateway&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_count=1&_session_manager_WAR_Gateway__jsfBridgeAjax=true&_session_manager_WAR_Gateway__facesViewIdResource=%2Fsession%2Flogin.xhtml
http://localhost:8080/home?p_p_id=session_manager_WAR_Gateway&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_count=1&_session_manager_WAR_Gateway_javax.faces.resource=jsf.js&_session_manager_WAR_Gateway_ln=javax.faces
http://localhost:8080/home?p_p_id=session_manager_WAR_Gateway&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_count=1&_session_manager_WAR_Gateway_javax.faces.resource=bridge.js&_session_manager_WAR_Gateway_ln=ice.core
http://localhost:8080/home?p_p_id=session_manager_WAR_Gateway&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_count=1&_session_manager_WAR_Gateway_javax.faces.resource=util%2Face-jquery.js&_session_manager_WAR_Gateway_ln=icefaces.ace
http://localhost:8080/home?p_p_id=session_manager_WAR_Gateway&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_count=1&_session_manager_WAR_Gateway_javax.faces.resource=compat.js&_session_manager_WAR_Gateway_ln=ice.compat
http://localhost:8080/home?p_p_id=session_manager_WAR_Gateway&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_count=1&_session_manager_WAR_Gateway_javax.faces.resource=util%2Face-components.js&_session_manager_WAR_Gateway_ln=icefaces.ace
http://localhost:8080/home?p_p_id=session_manager_WAR_Gateway&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_count=1&_session_manager_WAR_Gateway_javax.faces.resource=icefaces-compat.js&_session_manager_WAR_Gateway_ln=ice.compat
http://localhost:8080/home?p_p_id=session_manager_WAR_Gateway&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_count=1&_session_manager_WAR_Gateway_javax.faces.resource=util%2Face-menu.js&_session_manager_WAR_Gateway_ln=icefaces.ace
Note that "localhost" is mapped to an organization site in Liferay.
The first line in the "immediate" true case is the same as the line in the false case. The subsequent lines have several problems.
Problem 1: There's no logical reason for all this extra traffic. Pressing the button in the false case sends only a single request/response; pressing the button in the true case isn't doing anything more from an application perspective so the extra traffic is completely unwarranted.
Problem 2: The first line is properly encoded. The second line has the query parameters escaped, with '&" replaced with "&"; this thoroughly messes things up for Liferay.
Problem 3: As a result of problem 2, bean management goes to hell in a handbasket. All of our beans use @CustomScoped("#{window}") and tracking the constructor for the bean in view A shows that it's being called multiple times, once for each request other than the first one. Deep inspection of the bean map in the window scope shows that a different window map is being created for each request (hardly surprising given the mess of the URLs). This, naturally, has an impact on application functionality as well as on its performance (the constructors often have side effects such as loading data from the database).
Although we're using ICEfaces for the bulk of our components, the problem occurs whether we use <ace:pushButton> or <h:commandButton> to cancel view B; it's the "immediate" attribute that is causing the grief.
-
Hide
- Immediate_Bug_src.zip
- 7 kB
- Kevin Dean
-
- src/immediatebug/BaseViewBean.java 0.5 kB
- src/immediatebug/ViewABean.java 0.3 kB
- src/immediatebug/ViewBBean.java 0.3 kB
- WebContent/META-INF/MANIFEST.MF 0.0 kB
- WebContent/template.xhtml 0.7 kB
- WebContent/view_a.xhtml 0.5 kB
- WebContent/view_b.xhtml 0.5 kB
- WebContent/WEB-INF/liferay-display.xml 0.3 kB
- WebContent/WEB-INF/liferay-hook.xml 0.2 kB
- WebContent/.../liferay-plugin-package.xml 0.7 kB
- WebContent/WEB-INF/liferay-portlet.xml 0.4 kB
- WebContent/WEB-INF/portlet.xml 0.7 kB
- WebContent/WEB-INF/sun-web.xml 0.5 kB
- WebContent/WEB-INF/web.xml 0.7 kB
-
Hide
- Immediate_Bug.war
- 7.71 MB
- Kevin Dean
-
- META-INF/MANIFEST.MF 0.0 kB
- template.xhtml 0.7 kB
- view_a.xhtml 0.5 kB
- view_b.xhtml 0.5 kB
- WEB-INF/classes/.../BaseViewBean.class 0.9 kB
- WEB-INF/classes/.../ViewABean.class 0.5 kB
- WEB-INF/classes/.../ViewBBean.class 0.5 kB
- WEB-INF/classes/log4j.properties 0.2 kB
- WEB-INF/classes/logging.properties 0.2 kB
- WEB-INF/faces-config.xml 0.3 kB
- WEB-INF/jsp/_servlet_context_include.jsp 1.0 kB
- WEB-INF/lib/icefaces-ace.jar 4.02 MB
- WEB-INF/lib/icefaces-compat.jar 2.59 MB
- WEB-INF/lib/icefaces.jar 580 kB
- WEB-INF/.../liferay-faces-bridge-api-3.1.1-ga2.jar 29 kB
- WEB-INF/.../liferay-faces-bridge-impl-3.1.1-ga2.jar 449 kB
- WEB-INF/.../liferay-faces-portal-3.1.1-ga2.jar 90 kB
- WEB-INF/.../liferay-faces-util-3.1.1-ga2.jar 104 kB
- WEB-INF/lib/util-bridges.jar 69 kB
- WEB-INF/lib/util-java.jar 181 kB
- WEB-INF/lib/util-taglib.jar 313 kB
- WEB-INF/liferay-display.xml 0.2 kB
- WEB-INF/liferay-hook.xml 0.1 kB
- WEB-INF/liferay-plugin-package.xml 0.7 kB
- WEB-INF/liferay-portlet.xml 0.3 kB
- WEB-INF/liferay-web.xml 12 kB
- WEB-INF/portlet.xml 0.7 kB
- WEB-INF/sun-web.xml 0.5 kB
- WEB-INF/tld/aui.tld 88 kB
- WEB-INF/tld/liferay-portlet-ext.tld 14 kB
-
Hide
- localhost_har.zip
- 168 kB
- Kevin Dean
-
- localhost.immediate=false.0.har 19 kB
- localhost.immediate=true.0.har 267 kB
- localhost.immediate=true.1.har 267 kB
- localhost.immediate=true.2.har 267 kB
- localhost.immediate=true.3.har 267 kB
- localhost.immediate=true.4.har 267 kB
- localhost.immediate=true.5.har 267 kB
- localhost.immediate=true.6.har 267 kB
- localhost.immediate=true.7.har 267 kB
Activity
- All
- Comments
- History
- Activity
- Remote Attachments
- Subversion
The Immediate_Bug.war file is the final deployed WAR file after Liferay does its thing; the Immediate_Bug_src.zip file is the source.
The test is very simple:
Install the portlet.
Start network activity monitor.
Press the button.
Note only one request/response pair in activity monitor.
Press the button.
Note multiple request/response pairs in activity monitor.
Press the button.
Note multiple request/response pairs in activity monitor. It seems that the "immediate" setting corrupts further interaction with the portlet.
This is deployed to GlassFish 3.1.2.2.
It seems that when I created the forum entry (from which I copied this material), the ampersand encoding got stripped out. For example, the second URL when the "immediate" flag is true should be:
The HAR files I uploaded give exact details.
The problem has been traced to Liferay Faces Bridge. See http://issues.liferay.com/browse/FACES-1618?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel for details. This bug may be closed.
The attached file contains HTTP archives of all the traffic.