In my jsf application I have plenty of static FacesContext
related utility methods.
And always I ask myself the same question?
Should I pass the context via an argument to the method? Or use FacesContext.getCurrentInstance()
For example:
public static <T> T getInstance(final Class<T> type, final FacesContext context, final String elExpression)
{
return context.getApplication().evaluateExpressionGet(context, elExpression, type);
}
Even more confusion appears, since the validator and converter interfaces use the context as an argument.
Can there be more then one FacesContext?