Spring中XML配置注入枚举类型值
程序员文章站
2022-06-17 16:29:58
...
http://*.com/questions/14072314/inject-the-value-of-an-enum-into-a-property-using-spring
即使用方式即可
<util:constant static-field="package.MyEnum.ABC"/>
<bean id="firstKey" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"> <property name="targetObject"><util:constant static-field="package.MyEnum.ABC"/></property> <property name="targetMethod" value="value" /> </bean>
即使用方式即可
<util:constant static-field="package.MyEnum.ABC"/>
上一篇: JS得到当前时间字符串
推荐阅读