How to deploy global managed beans
- by frank.nimphius
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
Normal
0
false
false
false
false
EN-US
X-NONE
X-NONE
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:"Table Normal";
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-qformat:yes;
mso-style-parent:"";
mso-padding-alt:0in 5.4pt 0in 5.4pt;
mso-para-margin:0in;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;}
"Global managed" beans is the term I use in this
post to describe beans that are used across applications. Global managed beans
contain helper - or utility - methods like or instead of JSFUtils and ADFUtils.
The difference between global managed beans and static helper classes like JSFUtis
and ADFUtils is that they are EL accessible, providing reusable functionality
that is ready to use on UI components and - if accessed from Java - in other managed
beans.
For example, the
ADF Faces page template (af:pageTemplate)
allows you to define attributes for the consuming page to pass in object
references or strings into it. It does not have method attributes that allow command
components contained in a template to invoke listeners in managed beans and the
ADF binding layer, or to execute actions. To create templates that provide
global button or menu functionality, like logon, logout, print etc., an option
for developers is to deployed managed beans with the ADF Faces page templates. To
deploy a managed bean with a page template, create an ADF library from the
project containing the template definition and import this ADF library into the
target project using the Resource palette. When importing an ADF library, all
its content is added to the project, including page template definitions, managed
bean sources and configurations.
More about page templates
http://download.oracle.com/docs/cd/E17904_01/apirefs.1111/e12419/tagdoc/af_pageTemplate.html
Another use-case
for globally configured managed beans is for creating helper methods to be used
in many applications. Instead of creating a base managed bean class that then is
extended by all managed beans used in applications, you can deploy a managed
bean in a JAR file and add the faces-config.xml file with the managed bean configuration
to the JAR's META-INF folder as shown below.
Using a globally configured managed bean allows you to use
Expression Language in the UI to access common functionality but also use Java
in application specific managed beans. Storing the faces-config.xml file in the
JAR file META-INF directory automatically makes it available when the JAR file
is found in the class path of an application.