|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.empire.jsf2.app.impl.MyFacesImplementation
public class MyFacesImplementation
Constructor Summary | |
---|---|
MyFacesImplementation()
|
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); |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MyFacesImplementation()
Method Detail |
---|
public void initApplication(FacesApplication application)
FacesImplementation
initApplication
in interface FacesImplementation
application
- the FacesApplication instance
Implementation example:
---------------------------
ApplicationFactoryImpl applFactoryImpl = new ApplicationFactoryImpl();
// set implementation
application.setImplementation(this, applFactoryImpl.getApplication());
applFactoryImpl.setApplication(application);public void registerManagedBean(String beanName, String beanClass, String scope)
FacesImplementation
registerManagedBean
in interface FacesImplementation
public Object getManagedBean(String beanName, javax.faces.context.FacesContext fc)
FacesImplementation
getManagedBean
in interface FacesImplementation
public javax.faces.component.UIComponent getValueParentComponent(javax.el.ValueExpression ve)
FacesImplementation
getValueParentComponent
in interface FacesImplementation
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |