This content has been marked as final.
Show 1 reply
-
1. Re: JSF and Portal
ssilvert Apr 2, 2007 10:33 AM (in response to kreilly)Using modes with JSF is a research topic at this point. There is no agreement on the best way to do it. Here is one approach: http://wiki.apache.org/myfaces/UsingPortletModes
You can get the request object by calling FacesContext.getExternalContext().getRequest(). You should check to make sure that you can cast to the PortletRequest if you think your code will be used outside a portlet. If you are using the MyFaces portlet bridge, see http://wiki.apache.org/myfaces/UsingPortletUtil
Also, you can access managed beans using the EL.String value = (String)facesContext.getApplication() .createValueBinding("#{foo.prop}") .getValue(facesContext));
If you are outside the JSF lifecycle, you won't have access to the FacesContext. In this case, you need to get the Application object from the ApplicationFactory.ApplicationFactory appFactory = (ApplicationFactory) FactoryFinder.getFactory(FactoryFinder.APPLICATION_FACTORY); Application app = appFactory.getApplication();
Stan
http://jsf.jboss.com