JBoss Community Archive (Read Only)

Portlet Bridge 3.0

Tips

Excluding Attributes from Bridge Request Scope

When your application uses request attributes on a per request basis and you do not want that particular attribute to be managed in the Bridge Request Scope, you must use the following configuration in your faces-config.xml to have them excluded.

<application>
  <application-extension>
    <bridge:excluded-attributes>
      <bridge:excluded-attribute>foo.bar</bridge:excluded-attribute>
      <bridge:excluded-attribute>foo.baz.*</bridge:excluded-attribute>
    </bridge:excluded-attributes>
  </application-extension>
</application>

Above you will see that any attribute namespaced as foo.bar or any attribute beginning with foo.baz. will be excluded from the Bridge Request Scope and only be used per that application's request.

JSF Facelet View

When creating a JSF Facelet view document it's common to wrap the content with:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j">
...
</html>

As a single portlet only reflects a potentially small portion of the HTML markup for a page, a JSF portlet returning the above markup for each portlet can be distracting and potentially problematic.

The recommended way to wrap the content of a JSF Facelet view document for a portlet is:

<f:view xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:a4j="http://richfaces.org/a4j">
...
</f:view>

This results in only the relevant content of the portlet markup being returned to the page.

Although it is not relevant to a portlet, it's important to include <h:head> and <h:body> elements so that JSF can process the Facelet correctly.

JBoss.org Content Archive (Read Only), exported from JBoss Community Documentation Editor at 2020-03-11 12:26:02 UTC, last content change 2012-08-28 17:44:17 UTC.