public void setAttribute(String name, Object value) { invalidateIfNeeded(); if (value != null) { if (value instanceof ScriptSessionBindingListener) { ScriptSessionBindingListener listener = (ScriptSessionBindingListener) value; listener.valueBound(new ScriptSessionBindingEvent(this, name)); } attributes.put(name, value); } else { removeAttribute(name); } }