if (object instanceof DomainObject) { String usedConverterName = getNextDomainObjectConverter();  DomainObject domainObject = (DomainObject) object; String objectValue = MetaObjectFactory.createObject(domainObject, null).getKey().toString();  addHiddenSlot(slot, objectValue, usedConverterName); } else { addHiddenSlot(slot, object, converterName); }
addHiddenSlot(slot, object, converterName);
    protected void addHiddenSlot(String slot, Object value, String converterName) throws JspException {        if (value instanceof Collection) {            Collection collection = (Collection) value;            for (Object object : collection) {                if (object instanceof DomainObject) {                    String usedConverterName = getNextDomainObjectConverter();                                        DomainObject domainObject = (DomainObject) object;                    String objectValue = MetaObjectFactory.createObject(domainObject, null).getKey().toString();                                        addHiddenSlot(slot, objectValue, usedConverterName);                }                else {                    addHiddenSlot(slot, object, converterName);                }            }        }        else {            super.addHiddenSlot(slot, value, converterName);        }    }