@Override public void begin(InterpretationContext ic, String elementName, Attributes attributes) throws ActionException { String name = attributes.getValue(NAME_ATTRIBUTE); String source = attributes.getValue(SOURCE_ATTRIBUTE); Scope scope = ActionUtil.stringToScope(attributes.getValue(SCOPE_ATTRIBUTE)); String defaultValue = attributes.getValue(DEFAULT_VALUE_ATTRIBUTE); if (OptionHelper.isEmpty(name) || OptionHelper.isEmpty(source)) { addError( "The \"name\" and \"source\" attributes of <springProperty> must be set"); } ActionUtil.setProperty(ic, name, getValue(source, defaultValue), scope); }
@Override public void begin(InterpretationContext ic, String elementName, Attributes attributes) throws ActionException { String name = attributes.getValue(NAME_ATTRIBUTE); String source = attributes.getValue(SOURCE_ATTRIBUTE); Scope scope = ActionUtil.stringToScope(attributes.getValue(SCOPE_ATTRIBUTE)); if (OptionHelper.isEmpty(name) || OptionHelper.isEmpty(source)) { addError( "The \"name\" and \"source\" attributes of <springProperty> must be set"); } ActionUtil.setProperty(ic, name, getValue(source), scope); }
/** {@inheritDoc} */ @Override public void begin(InterpretationContext ic, String name, Attributes attributes) throws ActionException { String key = attributes.getValue(NAME_ATTRIBUTE); Scope scope = ActionUtil.stringToScope(attributes.getValue(SCOPE_ATTRIBUTE)); String source = attributes.getValue("source"); String defaultValue = attributes.getValue("defaultValue"); String value = environment.getProperty(source, defaultValue); ActionUtil.setProperty(ic, key, value, scope); }