// Make sure our bridge instance is handling this context
String portletName = (String) ((FacesContext) elContext.getContext(FacesContext.class)).getExternalContext().getRequestMap().get(PORTLET_NAME_ATTRIBUTE);
if (portletName != null && portletName.equals(mPortletConfig.getPortletName()))
{
PortletELContextImpl portletELContext;
if (elContext instanceof PortletELContextImpl)
{
// Grr -- turns out that by the time my resolver is called the ELContext may
// have been wrapped -- so mark here as a FacesResolver and then do a put context
portletELContext = (PortletELContextImpl) elContext;
portletELContext.setFacesResolved(true);
// Put the portletConfig object into this Map
portletELContext.setPortletConfig(mPortletConfig);
}
else
{
// create a PortletELContext to hold future resolver state and place on this context
portletELContext = new PortletELContextImpl(elContext.getELResolver());
portletELContext.setFacesResolved(false);
}
elContext.putContext(PortletELContextImpl.class, portletELContext);
}
}