There are no specific requirements to use Portlet Bridge in a JSF portlet, but it does need to be a JSF2 portlet for this version of the Portlet Bridge to function as expected.
There are now a few different ways to include Portlet Bridge into your application.
The following dependencies are required in your pom.xml for a JSF2 portlet:
If your portlet uses RichFaces 4, then you will also need the following dependency:
Using the new Portlet Bridge depchain poms it's possible to reduce what needs to be added to your pom.xml to a single dependency.
For a JSF2 portlet add:
For a RichFaces 4 portlet add:
When deploying to GateIn, the Portlet Bridge is automatically included for JSF2 portlets.
If you use the Portlet Bridge API in your code you still need to add it to your pom.xml with a provided scope. To do this the following dependency is required in your pom.xml:
If your portlet uses RichFaces 4, then you will need to include the Portlet Bridge RichFaces extension as this is not included with GateIn. It is important that you include the same version of the extension as the one bundled with GateIn.
You can find out what version is included in GateIn by looking in the directory $GATEIN_HOME/modules/org/jboss/portletbridge/api/main.
To do this the following dependency is required in your pom.xml:
If you still want to include the Portlet Bridge in your application you can disable the automatic inclusion of Portlet Bridge. This could, for example, be useful if you need to use a different version of Portlet Bridge.
To do that, just specify the WAR_BUNDLES_PORTLETBRIDGE context param in your web.xml file like this:
The automatic inclusion of Portlet Bridge is also disabled if you are not using the bundled JSF2 implementation (by specifying either WAR_BUNDLES_JSF or JSF_CONFIG_NAME context parameters).
Portlet Bridge provides the following example JSF2 portlets to assist in including the framework into your own portlets, as well as demonstrating the functionality available. Currently the following examples are available:
- JSF2 Portlet: basic JSF2 portlet showing f:ajax functionality
- RichFaces4 Simple: RichFaces 4 form with ajax submission and extended data table showing the submitted data.
- RichFaces4 Showcase: RichFaces 4 Showcase application, with portlet specific changes
- CDI and JSF2 Portlet: CDI and JSF2 example portlet showing long running conversations, as well as application scoped bean.
- DeltaSpike with CDI and JSF2 Portlet: CDI and JSF2 portlet showing usage of DeltaSpike for advanced CDI usage. Shows how to run the example from DeltaSpike as a portlet.
If you have other ideas of example portlets, please let us know in the forums.