1 Reply Latest reply on Nov 2, 2012 8:57 AM by Ken Finnigan

    Resource Serving

    Joe Padula Novice

      Hi,

      I was reread the section in the reference guide, on Resource Serving. Could you show a little snip of where I would place this? Does it go in top of .xhtml file?

      #{resource['/stylesheet.css']}

      https://docs.jboss.org/author/display/PBR/Reference+Guide#ReferenceGuide-Ifyou%27reusingFacelets%3A

       

      Here is how we used to do it (pre JSF2):

       

      <link rel="StyleSheet" type="text/css"

                          href="/dev-portlet-resources/css/modalPanel.css" />

       

      I've seen example by mkyong for JSF2 like this:

      <h:outputStylesheet library="css" name="style.css"  />

      http://www.mkyong.com/jsf2/how-to-include-cascading-style-sheets-css-in-jsf/

       

      Thanks for your help.

        • 1. Re: Resource Serving
          Ken Finnigan Master

          Joseph,

           

          I'll rewrite that section now, as it is a little ambigious.

           

          Basically you need to reference resources in a JSF2 way to enable them to become portal urls.

           

          So the <h:outputStylesheet> example from mkyong.com is correct for use with JSF2 and Portlet Bridge.

           

          Using #{resource} is useful for use inside css files, or for referencing files not through JSF2 tags.

           

          Ken