private void invokeCallback(StateItem item) { if (!"".equals(item.getCallback())) { Application application = FacesContext.getCurrentInstance().getApplication(); ExpressionFactory expressionFactory = application.getExpressionFactory(); ELContext el = FacesContext.getCurrentInstance().getELContext(); try { MethodExpression me = expressionFactory.createMethodExpression( el, item.getCallback(), Void.class, new Class[] {}); me.invoke(el, null); } catch (NullPointerException ex) { ex.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } } }