Tapestry 5
  1. Tapestry 5
  2. TAP5-355

TapestrySpring does not support injection of Spring FactoryBeans

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.1.0.0
    • Component/s: tapestry-spring
    • Labels:
      None
    • Environment:
      Spring 2.5.5

      Description

      This applies as of the released 5.0.16.

      SpringModuleDef uses BeanFactoryUtils.beanNamesIncludingAncestors(context) to get the list of bean names to inject into Tapestry service registry.

      For factory beans, this method returns the bean name prefixed by &

      Later calls to context.getBean() using this name return the factory bean instance, rather than the target object needed by the application.

      Suggested fix:

      Replace

      for (final String beanName : BeanFactoryUtils.beanNamesIncludingAncestors(context))
      {

      with

      for (final String candidate : BeanFactoryUtils.beanNamesIncludingAncestors(context))
      {
      final String beanName = (candidate.startsWith("&", candidate.subString(1), candidate);

        Activity

        Phil Zoio created issue -
        Andreas Andreou made changes -
        Field Original Value New Value
        Component/s tapestry-spring [ 12311660 ]
        Key TAPESTRY-2706 TAP5-355
        Project Tapestry [ 10573 ] Tapestry 5 [ 12310833 ]
        Component/s tapestry-spring [ 12312472 ]
        Fix Version/s 5.0.16 [ 12313417 ]
        Fix Version/s 5.0.16 [ 12313427 ]
        Howard M. Lewis Ship made changes -
        Assignee Howard M. Lewis Ship [ hlship ]
        Howard M. Lewis Ship made changes -
        Status Open [ 1 ] In Progress [ 3 ]
        Howard M. Lewis Ship made changes -
        Status In Progress [ 3 ] Closed [ 6 ]
        Fix Version/s 5.0.16 [ 12313427 ]
        Fix Version/s 5.1.0.0 [ 12313428 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            Howard M. Lewis Ship
            Reporter:
            Phil Zoio
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development