|
Define Managed Beans
To make use of our classes as JSF managed beans, we need to declare them in our faces-config.xml file. We plan to have two counters: an application-scoped counter based on the ApplicationCounter class and a session-scoped counter based on our basic Counter class. So we need to define two JSF managed beans.
Create a file called faces-config.xml by typing or copying the following into your editor:
<?xml version='1.0' encoding='UTF-8'?> <faces-config> <managed-bean> <description>An application-scoped counter.</description> <managed-bean-name>applicationCounter</managed-bean-name> <managed-bean-class> org.icefaces.tutorial.easyajaxpush.ApplicationCounter </managed-bean-class> <managed-bean-scope>application</managed-bean-scope> </managed-bean> <managed-bean> <description>A session-scoped counter.</description> <managed-bean-name>sessionCounter</managed-bean-name> <managed-bean-class> org.icefaces.tutorial.easyajaxpush.Counter </managed-bean-class> <managed-bean-scope>session</managed-bean-scope> </managed-bean> </faces-config>
Copyright 2005-2009. ICEsoft Technologies, Inc. |