我得到了解決
我在應用程序簽名布爾getReadAccess的方法(字符串角色,字符串模塊)。如果我想在另一個Bean使用的話,我必須請按照下列步驟
`javax.el.MethodExpression readAccess;
javax.el.ELContext elContext = null;
javax.faces.context.FacesContext context = FacesContext.getCurrentInstance();
elContext = ((FacesContext) context).getELContext();
javax.faces.application.Application application = FacesContext.getCurrentInstance().getApplication();
javax.el.ExpressionFactory expressionFactory = application.getExpressionFactory();
readAccess = expressionFactory.createMethodExpression(elContext,
"#{navigationBean.getReadAccess}", Void.class, new Class[] {
String.class, String.class });
//--------Call----------------------------
return (Boolean) readAccess.invoke(elContext, new Object[] {
"roleName", "moduleName" });
`
這不是一個解決方案。這是一種解決方法/破解。 – BalusC 2011-05-24 04:28:41