How to create a JSF Portlet using MyFaces:
Option 1: MyFacesGenericPortlet
Make sure your JSF MyFaces application runs as a stand-alone servlet.
- Remove any redirects from your faces-config.xml. Portlets can not handle these.
- Create a Portlet WAR as per the instructions for your Portlet container. Make sure it contains everything that was included in step 1.
- Update your portlet.xml file as follows:
<!-- You must use this Portlet impl class -->
<!-- The "home page" of your JSF application -->
<!-- This is a required param. -->
<!-- A class name that implements org.apache.myfaces.portlet.DefaultViewSelector -->
<!-- This optional param is used if your want to choose different default views -->
<!-- based on some condition. You still must specify default-view above, but -->
<!-- this impl will take precedence. -->
Option 2: Apache Portal Bridge
- put portal bridge jar files inside /WEB-INF/lib.
Caution: Option 1 can work inside/outside portlet, and Option 2 can't work standalone, unless remove the bridge jar. I think it is a bug.