com.davesag.jsf
Class AbstractContextAwareBean

java.lang.Object
  extended bycom.davesag.jsf.AbstractContextAwareBean
Direct Known Subclasses:
AbstractHandler, UserAgent

public abstract class AbstractContextAwareBean
extends Object

The AbstractContextAwareBean provides a bunch of handy methods that your own managed beans can use.

Version:
CVS Revision $Id:$

Constructor Summary
AbstractContextAwareBean()
           
 
Method Summary
protected  void addMessage(javax.faces.application.FacesMessage.Severity severity, String messageKey, Object[] params)
          add a message with the given severity, messageKey and params.
protected  javax.faces.context.ExternalContext getContext()
          Convenience utility method to get the external context.
protected  String getMessageBundleName()
          Convenience utility method to get the name of the application's message bundle.
protected  String getRequestParameter(String paramName)
          Gets the value of a request parameter.
protected  javax.servlet.ServletContext getServletContext()
          Convenience utility method to get access to the underlying servlet context.
protected  javax.servlet.http.HttpSession getSession()
          Convenience utility method to get access to the underlying servlet context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractContextAwareBean

public AbstractContextAwareBean()
Method Detail

getContext

protected javax.faces.context.ExternalContext getContext()
Convenience utility method to get the external context.

Returns:
the ExternalContext

getMessageBundleName

protected String getMessageBundleName()
Convenience utility method to get the name of the application's message bundle.

Returns:
the messag ebundle name as defined in faces-confix.xml

addMessage

protected void addMessage(javax.faces.application.FacesMessage.Severity severity,
                          String messageKey,
                          Object[] params)
add a message with the given severity, messageKey and params.

Parameters:
severity - The severity of the message.
messageKey - The key for the message.
params - An array of params.

getServletContext

protected javax.servlet.ServletContext getServletContext()
Convenience utility method to get access to the underlying servlet context.

Returns:
the servlet context if available, or null if not.

getSession

protected javax.servlet.http.HttpSession getSession()
Convenience utility method to get access to the underlying servlet context.

Returns:
the servlet context if available, or null if not.

getRequestParameter

protected String getRequestParameter(String paramName)
Gets the value of a request parameter.

Parameters:
paramName - the name of the request parameter.
Returns:
the value of the request parameter.


JSF Helper API version 20 Jan 2005. (C) 2004 Dave Sag.