I got a solution
I have a method in the boolean application signature getReadAccess (String role, String module). If I want to use in another bean, then I have to follow these steps
`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" });
`
source share