2

I'm initialising my spring beans in my spring XML.

<bean class = "com.some.class">
    <property name = "sql" value ="select :id id, 3 weight from some.table"></property>
</bean>

<bean class = "com.some.class">
    <property name = "sql" value = "select :id id, 3 weight from another.table"></property>
</bean>

Now I want to set that 3 in a variable in the xml somewhere. How can I do this?

dwjohnston
  • 11,163
  • 32
  • 99
  • 194
  • 1
    See [*Using Variable Substitution from Configuration Files in Spring*](http://phillips4jc.blogspot.com/2012/04/using-variable-substitution-from.html) (and please fix your "XML" -- it's not [**well-formed**](http://stackoverflow.com/a/25830482/290085)). – kjhughes May 08 '15 at 01:33
  • possible duplicate of [Best ways to deal with properties values in XML file in Spring, Maven and Eclipses](http://stackoverflow.com/questions/13297157/best-ways-to-deal-with-properties-values-in-xml-file-in-spring-maven-and-eclips) – skaffman May 08 '15 at 01:35

0 Answers0