Forums de discussion

h:head elements appear inside <body>

Florian Huonder, modifié il y a 12 années.

h:head elements appear inside <body>

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

I have a JSF2/Primefaces 3.0.M1 page together with portletfaces bridge 2.0.0.
It works.
The problem is that the h:head elements are placed within the body of the portlet-page and not within the head.
I have this problem on Pluto 2.0.2 and Liferay 6.0.6.

What is the solution to get the head elements into <head> ?

best regards,
Florian
thumbnail
Neil Griffin, modifié il y a 12 années.

RE: h:head elements appear inside <body>

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
Unfortunately, even though Pluto is the Reference Implementation (RI) for the JSR 286 Portlet 2.0 specification, it does not support the standard mechanism for adding elements to the <head>...</head> section of the portal page.

See the following links:
http://portals.apache.org/pluto/portlet-2.0-apidocs/javax/portlet/PortalContext.html#MARKUP_HEAD_ELEMENT_SUPPORT
http://portals.apache.org/pluto/portlet-2.0-apidocs/javax/portlet/MimeResponse.html#MARKUP_HEAD_ELEMENT

This is considered to be an "optional" feature of Portlet 2.0 and so implementors can decide whether or not they want to implement it in their portlet containers.

So that's why PortletFaces Bridge has to put scripts and css into the outermost <div>...</div> of the portlet (relocates them from h:head to h:body).

It would be great if someone would fix Pluto to support this, and then contribute it back to the folks at Apache.
Florian Huonder, modifié il y a 12 années.

RE: h:head elements appear inside <body>

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

You're absolutely right.
This is a very important feature.

The strange thing is that in Liferay I have the same behavior.
But as far as I know, Liferay should support this part of the specification.

Regards,
Florian
thumbnail
Neil Griffin, modifié il y a 12 années.

RE: h:head elements appear inside <body>

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
Liferay 5.2 and 6.0 has a vendor-specific way of adding resources to the <head> section, and when the 2.0.0 version of the bridge detects Liferay, it uses that vendor-specific method.

Liferay 6.0.3 added support for the standard, but due to the following bug, we decided to keep using the vendor-specific way: http://issues.liferay.com/browse/LPS-11767

So it should be working for you with Liferay. What version of Liferay, and what version of the bridge are you using?
Florian Huonder, modifié il y a 12 années.

RE: h:head elements appear inside <body>

New Member Publications: 11 Date d'inscription: 17/03/11 Publications récentes
I use Liferay 6.0.6 and the bridge version is 2.0.0
thumbnail
Neil Griffin, modifié il y a 12 années.

RE: h:head elements appear inside <body>

Liferay Legend Publications: 2655 Date d'inscription: 27/07/05 Publications récentes
I just tried the example JSF2 and ICEfaces2 portlets in Liferay 6.0.6 with PortletFaces Bridge 2.0.0 and the jsf.js and bridge.js resources appear in the <head>...</head> section. Please download the binary WARS for those two portlets and deploy them in your environment to see if they work:

http://www.liferay.com/community/liferay-projects/liferay-faces/demos#jsf2-portlet

http://www.liferay.com/community/liferay-projects/liferay-faces/demos#icefaces3-portlet