|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.shale.view.AbstractFacesBean
public abstract class AbstractFacesBean
Convenient abstract base class for application beans that wish to interact with JavaServer Faces request processing facilities. WARNING - These methods are only effective during the lifecycle of a JavaServer Faces request.
$Id: AbstractFacesBean.java 464373 2006-10-16 04:21:54Z rahul $
Constructor Summary | |
---|---|
AbstractFacesBean()
|
Method Summary | |
---|---|
protected void |
erase()
Erase submitted values on all EditableValueHolder
components in the current view. |
protected void |
error(String summary)
Enqueue a global FacesMessage (not associated with any
particular component) containing the specified summary text and a
message severity level of FacesMessage.SEVERITY_ERROR . |
protected void |
error(javax.faces.component.UIComponent component,
String summary)
Enqueue a FacesMessage (associated with the
specified component) containing the specified summary text and a
message severity level of FacesMessage.SEVERITY_ERROR . |
protected void |
fatal(String summary)
Enqueue a global FacesMessage (not associated with any
particular component) containing the specified summary text and a
message severity level of FacesMessage.SEVERITY_FATAL . |
protected void |
fatal(javax.faces.component.UIComponent component,
String summary)
Enqueue a FacesMessage (associated with the
specified component) containing the specified summary text and a
message severity level of FacesMessage.SEVERITY_FATAL . |
protected javax.faces.application.Application |
getApplication()
Retiurn the Application instance for the current
web application. |
protected Map |
getApplicationMap()
Return a Map of the application scope attributes
for this web application. |
protected Object |
getBean(String name)
Return the named bean from request, session, or application scope. |
protected javax.faces.context.ExternalContext |
getExternalContext()
Return the ExternalContext instance for the
current request. |
protected javax.faces.context.FacesContext |
getFacesContext()
Return the FacesContext instance for the
current request. |
protected javax.faces.lifecycle.Lifecycle |
getLifecycle()
Return the configured Lifecycle instance for
the current application. |
protected Map |
getRequestHeaderMap()
Return a Map of the request headers included in this
request. |
protected Map |
getRequestMap()
Return a Map of the request scope attributes
for this request. |
String |
getRequestParameter(String name)
Return the first (or only) value for the specified request parameter. |
protected Map |
getRequestParameterMap()
Return a Map of the request parameters included in this
request. |
String[] |
getRequestParameterValues(String name)
Return an array of all the values for the specified request parameter, if there are any. |
protected Map |
getSessionMap()
Return a Map of the session scope attributes
for the current user. |
protected Object |
getValue(String expr)
Evaluate the specified value binding expression and return the value it points at. |
protected void |
info(String summary)
Enqueue a global FacesMessage (not associated with any
particular component) containing the specified summary text and a
message severity level of FacesMessage.SEVERITY_INFO . |
protected void |
info(javax.faces.component.UIComponent component,
String summary)
Enqueue a FacesMessage (associated with the
specified component) containing the specified summary text and a
message severity level of FacesMessage.SEVERITY_INFO . |
protected void |
log(String message)
Log the specified message to the server's log file. |
protected void |
log(String message,
Throwable throwable)
Log the specified message and exception to the server's log file. |
Object |
retrieveData(String key)
Return the data object stored (typically when the component tree was previously rendered) under the specified key, if any; otherwise, return null . |
void |
saveData(String key,
Object data)
Save the specified data object (which MUST be Serializable ) under the specified key, such that it can
be retrieved (via getData() ) on a s subsequent request
immediately after the component tree has been restored. |
protected void |
setBean(String name,
Object value)
Replace the value of any attribute stored in request scope, session scope, or application scope, under the specified name. |
protected void |
setValue(String expr,
Object value)
Evaluate the specified value binding expression, and replace the value it points at. |
protected void |
warn(String summary)
Enqueue a global FacesMessage (not associated with any
particular component) containing the specified summary text and a
message severity level of FacesMessage.SEVERITY_WARN . |
protected void |
warn(javax.faces.component.UIComponent component,
String summary)
Enqueue a FacesMessage (associated with the
specified component) containing the specified summary text and a
message severity level of FacesMessage.SEVERITY_WARN . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractFacesBean()
Method Detail |
---|
protected javax.faces.application.Application getApplication()
Retiurn the Application
instance for the current
web application.
protected Map getApplicationMap()
Return a Map
of the application scope attributes
for this web application.
protected javax.faces.context.ExternalContext getExternalContext()
Return the ExternalContext
instance for the
current request.
protected javax.faces.context.FacesContext getFacesContext()
Return the FacesContext
instance for the
current request.
protected javax.faces.lifecycle.Lifecycle getLifecycle()
Return the configured Lifecycle
instance for
the current application.
protected Map getRequestHeaderMap()
Return a Map
of the request headers included in this
request. If there is more than one header for a particular header
name, only the first value is included in this map.
protected Map getRequestMap()
Return a Map
of the request scope attributes
for this request.
protected Map getRequestParameterMap()
Return a Map
of the request parameters included in this
request. If there is more than one value for a particular parameter
name, only the first value is included in this map.
protected Map getSessionMap()
Return a Map
of the session scope attributes
for the current user.
protected Object getBean(String name)
Return the named bean from request, session, or application scope.
If this is a managed bean, it might also get created as a side effect.
Return null
if no such bean can be found or created.
name
- Name of the desired beanprotected void setBean(String name, Object value)
Replace the value of any attribute stored in request scope, session scope, or application scope, under the specified name. If there is no such value, store this value as a new request scope attribute under the specified name.
name
- Name of the attribute to replace or createvalue
- Value to be storedprotected Object getValue(String expr)
Evaluate the specified value binding expression and return the value it points at.
expr
- Value binding expression to be evaluatedprotected void setValue(String expr, Object value)
Evaluate the specified value binding expression, and replace the value it points at.
expr
- Value binding expression pointing at a writeable propertyvalue
- New value to store therepublic Object retrieveData(String key)
Return the data object stored (typically when the component tree
was previously rendered) under the specified key, if any; otherwise,
return null
.
IMPLEMENTATION NOTE: Data objects will become
available only after the Restore View phase of the request
processing lifecycle has been completed. A common place to reinitialize
state information, then, would be in the preprocess()
event handler of a ViewController
backing bean.
key
- Key under which to retrieve the requested datapublic void saveData(String key, Object data)
Save the specified data object (which MUST be
Serializable
) under the specified key, such that it can
be retrieved (via getData()
) on a s subsequent request
immediately after the component tree has been restored.
IMPLEMENTATION NOTE: In order to successfully save
data objects, this method must be called before the Render Response
phase of the request processing lifecycle is executed. A common scenario
is to save state information in the prerender()
event handler
of a ViewController
backing bean.
key
- Key under which to store the requested datadata
- Data object to be storedprotected void erase()
Erase submitted values on all EditableValueHolder
components in the current view. This method should be called if
you have input components bound to data values, submit the form,
and then arbitrarily change the data that the binding points at
without going through the Update Model Values phase of
the request processing lifecycle.
public String getRequestParameter(String name)
Return the first (or only) value for the specified request parameter.
If no such request parameter exists for the current requset, return
null
instead.
name
- Name of the request parameter to look forpublic String[] getRequestParameterValues(String name)
Return an array of all the values for the specified request parameter,
if there are any. If no such request parameter exists for the current
request, return null
instead.
name
- Name of the request parameter to look forprotected void log(String message)
Log the specified message to the server's log file.
message
- Message to be loggedprotected void log(String message, Throwable throwable)
Log the specified message and exception to the server's log file.
message
- Message to be loggedthrowable
- Exception to be loggedprotected void info(String summary)
Enqueue a global FacesMessage
(not associated with any
particular component) containing the specified summary text and a
message severity level of FacesMessage.SEVERITY_INFO
.
summary
- Summary text for this messageprotected void info(javax.faces.component.UIComponent component, String summary)
Enqueue a FacesMessage
(associated with the
specified component) containing the specified summary text and a
message severity level of FacesMessage.SEVERITY_INFO
.
component
- Component with which this message is associatedsummary
- Summary text for this messageprotected void warn(String summary)
Enqueue a global FacesMessage
(not associated with any
particular component) containing the specified summary text and a
message severity level of FacesMessage.SEVERITY_WARN
.
summary
- Summary text for this messageprotected void warn(javax.faces.component.UIComponent component, String summary)
Enqueue a FacesMessage
(associated with the
specified component) containing the specified summary text and a
message severity level of FacesMessage.SEVERITY_WARN
.
component
- Component with which this message is associatedsummary
- Summary text for this messageprotected void error(String summary)
Enqueue a global FacesMessage
(not associated with any
particular component) containing the specified summary text and a
message severity level of FacesMessage.SEVERITY_ERROR
.
summary
- Summary text for this messageprotected void error(javax.faces.component.UIComponent component, String summary)
Enqueue a FacesMessage
(associated with the
specified component) containing the specified summary text and a
message severity level of FacesMessage.SEVERITY_ERROR
.
component
- Component with which this message is associatedsummary
- Summary text for this messageprotected void fatal(String summary)
Enqueue a global FacesMessage
(not associated with any
particular component) containing the specified summary text and a
message severity level of FacesMessage.SEVERITY_FATAL
.
summary
- Summary text for this messageprotected void fatal(javax.faces.component.UIComponent component, String summary)
Enqueue a FacesMessage
(associated with the
specified component) containing the specified summary text and a
message severity level of FacesMessage.SEVERITY_FATAL
.
component
- Component with which this message is associatedsummary
- Summary text for this message
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |