Uploaded image for project: 'Tapestry 5'
  1. Tapestry 5
  2. TAP5-355

TapestrySpring does not support injection of Spring FactoryBeans

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 5.1.0.0
    • tapestry-spring
    • None
    • 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);

      Attachments

        Activity

          People

            hlship Howard Lewis Ship
            philzoio Phil Zoio
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: