1)
把FacesContext当seam组件使用,可以直接在页面按表达式使用 ,#{facesContext......}
@Scope(ScopeType.APPLICATION)
@BypassInterceptors
@Name("org.jboss.seam.faces.facesContext")
@Install(precedence=BUILT_IN, classDependencies="javax.faces.context.FacesContext")
public class FacesContext
{
@Unwrap
public javax.faces.context.FacesContext getContext()
{
return javax.faces.context.FacesContext.getCurrentInstance();
}
}