com.sun.rave.web.ui.appbase
Class AbstractApplicationBean

java.lang.Object
  extended by com.sun.rave.web.ui.appbase.FacesBean
      extended by com.sun.rave.web.ui.appbase.AbstractApplicationBean

public abstract class AbstractApplicationBean
extends FacesBean

AbstractApplicationBean is the abstract base class for data bean(s) that are stored in application scope attributes. It extends FacesBean, so it inherits all of the default behavior found there. In addition, the following lifecycle methods are called automatically when the corresponding events occur:


Field Summary
protected  java.lang.String[][] encoding
          Mapping from the String version of the Locale for this response to the corresponding character encoding.
 
Constructor Summary
AbstractApplicationBean()
          Create a new application scope bean.
 
Method Summary
 void destroy()
          This method is called when this bean is removed from application scope.
 java.lang.String getLocaleCharacterEncoding()
          Return an appropriate character encoding based on the Locale defined for the current JavaServer Faces view.
 void init()
          This method is called when this bean is initially added to application scope.
 
Methods inherited from class com.sun.rave.web.ui.appbase.FacesBean
erase, error, error, fatal, fatal, getApplication, getApplicationMap, getBean, getCachedExceptions, getContext, getExternalContext, getFacesContext, getLifecycle, getRequestMap, getSessionMap, getValue, info, info, log, log, retrieveData, saveData, setBean, setValue, warn, warn
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

encoding

protected java.lang.String[][] encoding

Mapping from the String version of the Locale for this response to the corresponding character encoding. For each row, the first String is the value returned by the toString() method for the java.util.Locale for the current view, and the second String is the name of the character encoding to be used.

Only locales that use an encoding other than the default (UTF-8) need to be listed here.

Constructor Detail

AbstractApplicationBean

public AbstractApplicationBean()

Create a new application scope bean.

Method Detail

getLocaleCharacterEncoding

public java.lang.String getLocaleCharacterEncoding()

Return an appropriate character encoding based on the Locale defined for the current JavaServer Faces view. If no more suitable encoding can be found, return "UTF-8" as a general purpose default.

This method makes a convenient value binding target for the value property of a Set Encoding component. Applications that wish to specialize this behavior can override this method in their own application bean class.


init

public void init()

This method is called when this bean is initially added to application scope. Typically, this occurs as a result of evaluating a value binding or method binding expression, which utilizes the managed bean facility to instantiate this bean and store it into application scope.

You may customize this method to initialize and cache application wide data values (such as the lists of valid options for dropdown list components), or to allocate resources that are required for the lifetime of the application.


destroy

public void destroy()

This method is called when this bean is removed from application scope. Typically, this occurs as a result of the application being shut down by its owning container.

You may customize this method to clean up resources allocated during the execution of the init() method, or at any later time during the lifetime of the application.