Forums de discussion

PrimeFaces resource loading problems

Robert Lindblom, modifié il y a 13 années.

PrimeFaces resource loading problems

New Member Publications: 11 Date d'inscription: 17/03/11 Publications récentes
Hi.

I'm trying to use PortletFaces Bridge (2.0.0-BETA4) to develop a portlet for Liferay 6.0.5, using PrimeFaces 2.2.1.
The problems is that the resource links generated by PrimeFaces are totally screwed up, which leads to that no PrimeFaces resources are loaded. Please see http://primefaces.prime.com.tr/forum/viewtopic.php?f=3&t=8378 for details.

Could this be a PortletFaces Bridge problem?

Also see http://primefaces.prime.com.tr/forum/viewtopic.php?f=3&t=6693 for a similar discussion.
Robert Lindblom, modifié il y a 13 années.

RE: PrimeFaces resource loading problems

New Member Publications: 11 Date d'inscription: 17/03/11 Publications récentes
Some more information I think could be relevant:
If I use the <portlet:resourceURL> tag, like:

<portlet:resourceurl var="myResourceURL">
    <portlet:param name="foo" value="1234" />
</portlet:resourceurl>


the resulting url is:

http://localhost:8180/web/guest/test?p_p_id=1_WAR_primeportlet100SNAPSHOT_INSTANCE_11oL&p_p_lifecycle=2&p_p_state=normal&p_p_mode=view&p_p_resource_id=j_idt1&p_p_cacheability=cacheLevelPage&p_p_col_id=column-1&p_p_col_pos=1&p_p_col_count=2&_1_WAR_primeportlet100SNAPSHOT_INSTANCE_11oL_foo=1234
thumbnail
Neil Griffin, modifié il y a 13 années.

RE: PrimeFaces resource loading problems

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
Are you able to reproduce the problem with the portlet shown downloadable from here?
http://cagataycivici.wordpress.com/2011/02/02/primefaces-on-liferay/
Robert Lindblom, modifié il y a 13 années.

RE: PrimeFaces resource loading problems

New Member Publications: 11 Date d'inscription: 17/03/11 Publications récentes
That is the very portlet I'm trying to deploy, so yes.
thumbnail
Neil Griffin, modifié il y a 13 années.

RE: PrimeFaces resource loading problems

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
Can you paste here the rendered HTML elements (View->Source) of the resources that have bad URLs?
Robert Lindblom, modifié il y a 13 années.

RE: PrimeFaces resource loading problems

New Member Publications: 11 Date d'inscription: 17/03/11 Publications récentes
Sure, here is an example of a javascript include:


<script type="text/javascript" src="http://localhost:8180/web/guest/test?_1_WAR_primeportlet100SNAPSHOT_INSTANCE_11oL__1_WAR_primeportlet100SNAPSHOT_INSTANCE_11oL_javax.faces.resource=jquery%252Fui%252Fjquery-ui.js&amp;_1_WAR_primeportlet100SNAPSHOT_INSTANCE_11oL__1_WAR_primeportlet100SNAPSHOT_INSTANCE_11oL_ln=primefaces&amp;_1_WAR_primeportlet100SNAPSHOT_INSTANCE_11oL_javax.faces.resource=javax.faces.resource%3Djquery%252Fui%252Fjquery-ui.js%26_1_WAR_primeportlet100SNAPSHOT_INSTANCE_11oL_ln%3Dprimefaces%26p_p_cacheability%3DcacheLevelPage%26p_p_col_count%3D2%26p_p_col_id%3Dcolumn-1%26p_p_col_pos%3D1%26p_p_id%3D1_WAR_primeportlet100SNAPSHOT_INSTANCE_11oL%26p_p_lifecycle%3D2%26p_p_mode%3Dview%26p_p_state%3Dnormal&amp;p_p_cacheability=cacheLevelPage&amp;p_p_cacheability=cacheLevelPage&amp;p_p_col_count=2&amp;p_p_col_count=2&amp;p_p_col_id=column-1&amp;p_p_col_id=column-1&amp;p_p_col_pos=1&amp;p_p_col_pos=1&amp;p_p_id=1_WAR_primeportlet100SNAPSHOT_INSTANCE_11oL&amp;p_p_id=1_WAR_primeportlet100SNAPSHOT_INSTANCE_11oL&amp;p_p_lifecycle=2&amp;p_p_lifecycle=2&amp;p_p_mode=view&amp;p_p_mode=view&amp;p_p_state=normal&amp;p_p_state=normal&amp;v=2.2.1&amp;v=2.2.1"></script>
thumbnail
Neil Griffin, modifié il y a 13 années.

RE: PrimeFaces resource loading problems

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
Can you please add the following src/main/resources/log4j.properties file to the portlet in order to enable the logging? Afterwards, please paste the logger info from the tomcat log. Note that only the initial HTTP-GET is relevant.

https://github.com/liferay/liferay-faces/blob/master/demos/bridge/jsf2-portlet/src/main/resources/log4j.properties
Robert Lindblom, modifié il y a 13 années.

RE: PrimeFaces resource loading problems

New Member Publications: 11 Date d'inscription: 17/03/11 Publications récentes
I've investigated this further and actually got it to work, somewhat.
All tests have been done with PrimeFaces 2.2.1 and here are my findings:

Using 2.0.0-BETA3
Loading of resource files seem to mostly work fine.
Loading of image through CSS background attribute works, see attached log file 2.0.0-BETA3-img.txt.
One strange issue is that it seems to be a problem that manifests itself as styling not being applied, perhaps due to some CSS file loading problem. When loading the page with the portlet on, the correct styling is not applied, but when doing a CTRL-F5 reload the correct styling is applied. See attached log files 2.0.0-BETA3-load.txt and 2.0.0-BETA3-reload.txt.

Using 2.0.0-BETA4
Loading of resource files seem to mostly work fine.
Loading of image through CSS background attribute doesn't work, see attached log file 2.0.0-BETA4-img.txt.
PortletFaces Community Member, modifié il y a 13 années.

RE: PrimeFaces resource loading problems

Regular Member Publications: 199 Date d'inscription: 03/04/12 Publications récentes
I have the same problem

CSS Resource seems to be ok
http://localhost:8080/web/guest/home?_1_WAR_jsfportlet_javax.faces.resource=treeview%2Ftreeview.css&_1_WAR_jsfportlet_ln=primefaces&p_p_cacheability=cacheLevelPage&p_p_col_count=2&p_p_col_id=column-1&p_p_id=1_WAR_jsfportlet&p_p_lifecycle=2&p_p_mode=view&p_p_state=normal&v=2.2.1

But the links in CSS to image resource are wrong (underscores to visualize the missing part)
http://localhost:8080/web/guest/home?_______________________________________________________________________________________________p_p_cacheability=cacheLevelPage&p_p_col_count=2&p_p_col_id=column-1&p_p_id=1_WAR_jsfportlet&p_p_lifecycle=2&p_p_mode=view&p_p_state=normal&amp;v=2.2.1

This part is missing to get image
_1_WAR_jsfportlet_javax.faces.resource=treeview%2Fimages%2Fcheck2.gif&

The resource in CSS is defined by
background:url("#{resource['primefaces:treeview/images/check2.gif']}")

The following link will work to get the image
http://localhost:8080/web/guest/home?_1_WAR_jsfportlet_javax.faces.resource=treeview%2Fimages%2Fcheck2.gif&_1_WAR_jsfportlet_ln=primefaces&p_p_cacheability=cacheLevelPage&p_p_col_count=2&p_p_col_id=column-1&p_p_id=1_WAR_jsfportlet&p_p_lifecycle=2&p_p_mode=view&p_p_state=normal&amp;v=2.2.1
thumbnail
Neil Griffin, modifié il y a 13 années.

RE: PrimeFaces resource loading problems

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
Do you think that this is related to the following issue?
http://issues.liferay.com/browse/FACES-216
thumbnail
Neil Griffin, modifié il y a 13 années.

RE: PrimeFaces resource loading problems

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
FACES-216 has been fixed in the source repository. You can try building from the source repository now, but the fix will appear in version 2.0.0 (final). Please let me know if it fixes the problem discussed in this thread. Thanks.
PortletFaces Community Member, modifié il y a 13 années.

RE: PrimeFaces resource loading problems

Regular Member Publications: 199 Date d'inscription: 03/04/12 Publications récentes
It seems to work. The URL in CSS is now
http://localhost:8080/web/guest/home?_1_WAR_jsfportlet_javax.faces.resource=treeview/images/check1.gif&_1_WAR_jsfportlet_ln=primefaces&_1_WAR_jsfportlet_v=2.2-SNAPSHOT&p_p_col_count=2&p_p_col_id=column-1&p_p_id=1_WAR_jsfportlet&p_p_lifecycle=2&p_p_mode=view&p_p_state=normal&amp;v=2.2-SNAPSHOT

The missing Part has been fixed.
_1_WAR_jsfportlet_javax.faces.resource=treeview%2Fimages%2Fcheck2.gif&

I think this Issue is related to FACES-216.

Thanks