Announcement Announcement Module
No announcement yet.
Limitations of Autowiring Page Title Module
Move Remove Collapse
Conversation Detail Module
  • 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.

    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>

    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?