|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FacesImplementation
Method Summary | |
---|---|
Object |
getManagedBean(String beanName,
javax.faces.context.FacesContext fc)
Returns the parentComponent for a given ValueExpression. |
javax.faces.component.UIComponent |
getValueParentComponent(javax.el.ValueExpression ve)
Return the parentComponent for a given ValueExpression. |
void |
initApplication(FacesApplication application)
Init application |
void |
registerManagedBean(String beanName,
String beanClass,
String scope)
Registers a managed bean Implementation for Mojarra: --------------------------- FacesContext fc = FacesContext.getCurrentInstance(); BeanManager bm = ApplicationAssociate.getInstance(fc.getExternalContext()).getBeanManager(); // check if (bm.getRegisteredBeans().containsKey(beanName)) throw new ItemExistsException(beanName); // register now ManagedBeanInfo mbi = new ManagedBeanInfo(beanName, beanClass, "view", null, null, null, null); bm.register(mbi); Implementation for MyFaces: --------------------------- FacesContext fc = FacesContext.getCurrentInstance(); RuntimeConfig rc = RuntimeConfig.getCurrentInstance(fc.getExternalContext()); // check if (rc.getManagedBeans().containsKey(beanName)) throw new ItemExistsException(beanName); // register now ManagedBean mbi = new ManagedBean(); mbi.setName(beanName); mbi.setBeanClass(beanClass); mbi.setScope(scope); rc.addManagedBean(beanName, mbi); |
Method Detail |
---|
void initApplication(FacesApplication application)
application
- the FacesApplication instance
Implementation example:
---------------------------
ApplicationFactoryImpl applFactoryImpl = new ApplicationFactoryImpl();
// set implementation
application.setImplementation(this, applFactoryImpl.getApplication());
applFactoryImpl.setApplication(application);void registerManagedBean(String beanName, String beanClass, String scope)
Object getManagedBean(String beanName, javax.faces.context.FacesContext fc)
javax.faces.component.UIComponent getValueParentComponent(javax.el.ValueExpression ve)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |