Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: EE-3.0.0.GA, EE-3.0.0.GA_P01
-
Fix Version/s: EE-3.0.0.GA_P01, 3.2
-
Component/s: ACE-Components, Sample Apps
-
Labels:None
-
Environment:Liferay Portal Portlet ACE Data Exporter Component
Description
In testing the showcase-portlet examples on Liferay (any of 5.2.3, 6.0, 6.1), the following behaviour was observed when using IE. It exists in the EE-3.0.0.GA release as well as on the current maintenance branch.
When running any of the Data Exporter examples, after clicking the "Export File" button, the operation appears to simply silently fail. There were no client or server-side errors detected.
When running any of the Data Exporter examples, after clicking the "Export File" button, the operation appears to simply silently fail. There were no client or server-side errors detected.
Looks like it's not an IE problem specifically. The reason it only showed up on IE is that it was the only browser that I was testing with that wasn't using http://localhost:8080. Running Chrome from a remote machine shows the same issue.
The problem seems to stem from the initial update that comes back. When you go to the initial portal page from a browser on a different machine, the initial address might look something like:
http://myRemoteHostAddress:8080/web/guest/exporter
When you click the export button, the URL for the request looks something like:
http://myRemoteHostAddress:8080/web/guest/exporter?_dataExporter_WAR_showcaseportlet__facesViewId=%2Fportlet-view.xhtml&p_p_col_count=1&p_p_col_id=column-2&p_p_id=dataExporter_WAR_showcaseportlet&p_p_lifecycle=2
The response that comes back includes a script that needs to be run to actually fetch the resource. It looks like this (formatted a bit for readability):
<update id="A9102:form1:dataExporter_script">
<![CDATA[<span id="A9102:form1:dataExporter_script">
<script type="text/javascript">
ice.ace.jq(ice.ace.escapeClientId('A9102:form1:dataExporter')).button();
if (ice.ace.DataExporters['A9102:form1:dataExporter'])
ice.ace.DataExporters['A9102:form1:dataExporter'].url('http://localhost:8080/web/guest/exporter?_dataExporter_WAR_showcaseportlet_javax.faces.resource=s8040c1d4-6309-4ee5-8f0d-a44cf4bae1a7&p_p_col_count=1&p_p_col_id=column-2&p_p_id=dataExporter_WAR_showcaseportlet&p_p_lifecycle=2');
</script>
</span>]]>
</update>
The interesting part to note is the URL it's constructed that contains the resource id it'll be looking for. It starts with "http://localhost:8080/web/guest/exporter?...". So it's trying to make a request to localhost even though the original request was not localhost. This explains why it works when testing it locally.