Description of problem: Manual loading of (X)CSS files via <link> tag is often required, e.g. when using RichFaces with LoadStyleStrategy set to NONE. The documentation advises to use the code similar to the following line in that case: <link rel="stylesheet" type="text/css" href="/richFacesPortlet/faces/rfRes/org/richfaces/skin.xcss"/> This leads to NPE when the portlet is accessed (see the attached log). Version-Release number of selected component (if applicable): 2.3.0.CP01.EPP521 Additional info: There are different ways to load the styles which work fine, e.g. via a4j:loadStyle.
Created attachment 578316 [details] NPE caused by <link rel="stylesheet" type="text/css" href="/richFacesPortlet/faces/rfRes/org/richfaces/skin.xcss"/>.
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Documentation needs to be updated for Portlet Bridge to recommend following for including RichFaces scripts and stylesheets when using LoadStyleStrategy and LoadScriptStrategy of NONE: <a4j:loadScript src="resource:////org/ajax4jsf/framework.pack.js" type="text/javascript" /> <a4j:loadScript src="resource:////org/richfaces/ui.pack.js" type="text/javascript" /> <a4j:loadStyle src="resource:////org/richfaces/skin.xcss" />
Ken Finnigan <ken> updated the status of jira PBR-325 to Closed
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1,6 +1,6 @@ -Documentation needs to be updated for Portlet Bridge to recommend following for including RichFaces scripts and stylesheets when using LoadStyleStrategy and LoadScriptStrategy of NONE: +Documentation quoted that the <link> element could be used to import Rich Faces XCSS scripts and stylesheets using the following syntax <link rel="stylesheet" type="text/css" href="/richFacesPortlet/faces/rfRes/org/richfaces/skin.xcss"/>. This syntax is no longer correct, and results in a NPE. To correct the issue, use a4j:loadstyle to import the scripts and stylesheets when using LoadStyleStrategy and LoadScriptStrategy of NONE: - - <a4j:loadScript src="resource:////org/ajax4jsf/framework.pack.js" type="text/javascript" /> +<programlisting>[CDATA[ +<a4j:loadScript src="resource:////org/ajax4jsf/framework.pack.js" type="text/javascript" /> <a4j:loadScript src="resource:////org/richfaces/ui.pack.js" type="text/javascript" /> - <a4j:loadStyle src="resource:////org/richfaces/skin.xcss" />+ <a4j:loadStyle src="resource:////org/richfaces/skin.xcss" />]]</programlisting>
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1,6 +1,10 @@ -Documentation quoted that the <link> element could be used to import Rich Faces XCSS scripts and stylesheets using the following syntax <link rel="stylesheet" type="text/css" href="/richFacesPortlet/faces/rfRes/org/richfaces/skin.xcss"/>. This syntax is no longer correct, and results in a NPE. To correct the issue, use a4j:loadstyle to import the scripts and stylesheets when using LoadStyleStrategy and LoadScriptStrategy of NONE: +Documentation quoted that the <link> element could be used to import Rich Faces XCSS scripts and stylesheets using the following syntax:</para> -<programlisting>[CDATA[ +<programlisting>&[CDATA[<link rel="stylesheet" type="text/css" href="/richFacesPortlet/faces/rfRes/org/richfaces/skin.xcss"/>]];</programlisting>. + +<para>This syntax is no longer correct, and results in a NPE. To correct the issue, use a4j:loadstyle to import the scripts and stylesheets when using LoadStyleStrategy and LoadScriptStrategy of NONE: + +<programlisting>&[CDATA[ <a4j:loadScript src="resource:////org/ajax4jsf/framework.pack.js" type="text/javascript" /> <a4j:loadScript src="resource:////org/richfaces/ui.pack.js" type="text/javascript" /> - <a4j:loadStyle src="resource:////org/richfaces/skin.xcss" />]]</programlisting>+ <a4j:loadStyle src="resource:////org/richfaces/skin.xcss" />]];</programlisting>
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1,10 +1,10 @@ Documentation quoted that the <link> element could be used to import Rich Faces XCSS scripts and stylesheets using the following syntax:</para> -<programlisting>&[CDATA[<link rel="stylesheet" type="text/css" href="/richFacesPortlet/faces/rfRes/org/richfaces/skin.xcss"/>]];</programlisting>. +<programlisting><![CDATA[<link rel="stylesheet" type="text/css" href="/richFacesPortlet/faces/rfRes/org/richfaces/skin.xcss"/>]]></programlisting>. <para>This syntax is no longer correct, and results in a NPE. To correct the issue, use a4j:loadstyle to import the scripts and stylesheets when using LoadStyleStrategy and LoadScriptStrategy of NONE: -<programlisting>&[CDATA[ +<programlisting><![CDATA[ <a4j:loadScript src="resource:////org/ajax4jsf/framework.pack.js" type="text/javascript" /> <a4j:loadScript src="resource:////org/richfaces/ui.pack.js" type="text/javascript" /> - <a4j:loadStyle src="resource:////org/richfaces/skin.xcss" />]];</programlisting>+ <a4j:loadStyle src="resource:////org/richfaces/skin.xcss" />]]></programlisting>
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1,10 +1,10 @@ Documentation quoted that the <link> element could be used to import Rich Faces XCSS scripts and stylesheets using the following syntax:</para> -<programlisting><![CDATA[<link rel="stylesheet" type="text/css" href="/richFacesPortlet/faces/rfRes/org/richfaces/skin.xcss"/>]]></programlisting>. +<programlisting><link rel="stylesheet" type="text/css" href="/richFacesPortlet/faces/rfRes/org/richfaces/skin.xcss"/></programlisting> -<para>This syntax is no longer correct, and results in a NPE. To correct the issue, use a4j:loadstyle to import the scripts and stylesheets when using LoadStyleStrategy and LoadScriptStrategy of NONE: +<para>This syntax is no longer correct, and results in a NPE. To correct the issue, use a4j:loadstyle to import the scripts and stylesheets when using LoadStyleStrategy and LoadScriptStrategy of NONE:</para> -<programlisting><![CDATA[ +<programlisting> <a4j:loadScript src="resource:////org/ajax4jsf/framework.pack.js" type="text/javascript" /> <a4j:loadScript src="resource:////org/richfaces/ui.pack.js" type="text/javascript" /> - <a4j:loadStyle src="resource:////org/richfaces/skin.xcss" />]]></programlisting>+ <a4j:loadStyle src="resource:////org/richfaces/skin.xcss" /></programlisting>
Technical note updated. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. Diffed Contents: @@ -1,10 +1,3 @@ -Documentation quoted that the <link> element could be used to import Rich Faces XCSS scripts and stylesheets using the following syntax:</para> +Documentation quoted that the <link> element could be used to import Rich Faces XCSS scripts and stylesheets using the following syntax:</para><programlisting><link type="text/css" rel="stylesheet" href="/richFacesPortlet/faces/rfRes/org/richfaces/skin.xcss"/></programlisting><para>This syntax is no longer correct, and results in a NPE. To correct the issue, use a4j:loadstyle to import the scripts and stylesheets when using LoadStyleStrategy and LoadScriptStrategy of NONE:</para><programlisting><a4j:loadScript src="resource:////org/ajax4jsf/framework.pack.js" type="text/javascript"/> - + <a4j:loadScript src="resource:////org/richfaces/ui.pack.js" type="text/javascript"/> -<programlisting><link rel="stylesheet" type="text/css" href="/richFacesPortlet/faces/rfRes/org/richfaces/skin.xcss"/></programlisting> + <a4j:loadStyle src="resource:////org/richfaces/skin.xcss"/></programlisting>- -<para>This syntax is no longer correct, and results in a NPE. To correct the issue, use a4j:loadstyle to import the scripts and stylesheets when using LoadStyleStrategy and LoadScriptStrategy of NONE:</para> - -<programlisting> -<a4j:loadScript src="resource:////org/ajax4jsf/framework.pack.js" type="text/javascript" /> - <a4j:loadScript src="resource:////org/richfaces/ui.pack.js" type="text/javascript" /> - <a4j:loadStyle src="resource:////org/richfaces/skin.xcss" /></programlisting>