JBoss Community Archive (Read Only)

Portlet Bridge 3.3

Resource Serving

When using resources from your JSF portlet it's important to ensure that they are accessed in a way that allows the Portlet Bridge to generate an appropriate Portal URL to the resource being requested.

Using JSF 2 tags to access resources, such as <h:outputScript>, <h:outputStylesheet>, <h:graphicImage> and <h:link> all use JSF 2 mechanisms for generating the URL, and so should generate appropriate Portal URLs.

However, in some situations it may not be possible to use any of the above tags, such as image urls within css files, importing a css file from another, etc. In these situations the correct way to reference a resource is to place it within the resources folder of your web application so that the resource can be retrieved using JSF 2 Resource Handling such as:


stylesheet.css would be present in the root of the resources folder as it does not specify a resource library

Use of #{resource} to retrieve the content is especially important for @import within css files.

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-11 12:28:52 UTC, last content change 2012-12-04 16:40:00 UTC.