catalog.view.util
Class FacesUtils

java.lang.Object
  extended bycatalog.view.util.FacesUtils

public class FacesUtils
extends java.lang.Object

Utility class for JavaServer Faces.

Author:
Derek Y. Shen

Constructor Summary
FacesUtils()
           
 
Method Summary
static void addErrorMessage(java.lang.String msg)
          Add error message.
static void addErrorMessage(java.lang.String clientId, java.lang.String msg)
          Add error message to a sepcific client.
static void addInfoMessage(java.lang.String msg)
          Add information message.
static void addInfoMessage(java.lang.String clientId, java.lang.String msg)
          Add information message to a sepcific client.
static java.lang.Integer evalInt(java.lang.String el)
          Evaluate the integer value of a JSF expression.
static ApplicationBean getApplicationBean()
          Get ApplicationBean.
static java.lang.Object getManagedBean(java.lang.String beanName)
          Get managed bean based on the bean name.
static java.lang.String getRequestParameter(java.lang.String name)
          Get parameter value from request scope.
static javax.servlet.ServletContext getServletContext()
          Get servlet context.
static SessionBean getSessionBean()
          Get SessionBean.
static void resetManagedBean(java.lang.String beanName)
          Remove the managed bean based on the bean name.
static void setManagedBeanInSession(java.lang.String beanName, java.lang.Object managedBean)
          Store the managed bean inside the session scope.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FacesUtils

public FacesUtils()
Method Detail

getServletContext

public static javax.servlet.ServletContext getServletContext()
Get servlet context.

Returns:
the servlet context

getManagedBean

public static java.lang.Object getManagedBean(java.lang.String beanName)
Get managed bean based on the bean name.

Parameters:
beanName - the bean name
Returns:
the managed bean associated with the bean name

resetManagedBean

public static void resetManagedBean(java.lang.String beanName)
Remove the managed bean based on the bean name.

Parameters:
beanName - the bean name of the managed bean to be removed

setManagedBeanInSession

public static void setManagedBeanInSession(java.lang.String beanName,
                                           java.lang.Object managedBean)
Store the managed bean inside the session scope.

Parameters:
beanName - the name of the managed bean to be stored
managedBean - the managed bean to be stored

getRequestParameter

public static java.lang.String getRequestParameter(java.lang.String name)
Get parameter value from request scope.

Parameters:
name - the name of the parameter
Returns:
the parameter value

getApplicationBean

public static ApplicationBean getApplicationBean()
Get ApplicationBean.

Specific for this application.

Returns:
the application bean

getSessionBean

public static SessionBean getSessionBean()
Get SessionBean.

Specific for this applicaiton.

Returns:
the session bean

addInfoMessage

public static void addInfoMessage(java.lang.String msg)
Add information message.

Parameters:
msg - the information message

addInfoMessage

public static void addInfoMessage(java.lang.String clientId,
                                  java.lang.String msg)
Add information message to a sepcific client.

Parameters:
clientId - the client id
msg - the information message

addErrorMessage

public static void addErrorMessage(java.lang.String msg)
Add error message.

Parameters:
msg - the error message

addErrorMessage

public static void addErrorMessage(java.lang.String clientId,
                                   java.lang.String msg)
Add error message to a sepcific client.

Parameters:
clientId - the client id
msg - the error message

evalInt

public static java.lang.Integer evalInt(java.lang.String el)
Evaluate the integer value of a JSF expression.

Parameters:
el - the JSF expression
Returns:
the integer value associated with the JSF expression


Copyright (c) 2004 The JCatalog Project.