Announcement Announcement Module
Collapse
No announcement yet.
Limitations of Autowiring Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Limitations of Autowiring

    As per the below link it says:
    You cannot autowire so-called simple properties such as primitives, Strings, and Classes (and arrays of such simple properties). This limitation is by-design.

    http://static.springsource.org/sprin...red-exceptions

    But when I simply have the following String bean, in my beans.xml, @Autowired could resolve and inject the correct bean which means the autowiring worked in this case
    <bean class="java.lang.String">
    <constructor-arg value="testString"></constructor-arg>
    </bean>

    What exactly is the limitation link trying to state? Isn't the above example a clear case of autowiring String? Also the limitation link says it is by design. Why is it so?
Working...
X