Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-3748

s:bean doesn't allow creation of beans from a spring object factory using the bean's id

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.3.1.1
    • 2.3.3
    • Core Actions
    • None
    • linux, jdk 1.6

    Description

      on core/src/main/java/org/apache/struts2/components/Bean.java line 128:

      bean = objectFactory.buildBean(ClassLoaderUtil.loadClass(beanName, getClass()), stack.getContext());

      Shouldn't this be:

      bean = objectFactory.buildBean(beanName, stack.getContext(), false);

      The factory knows how to get a Class from a String as well as anyone, but the "name" is not necessarily a class name when the bean is the id of a spring bean.

      This affects s:bean tag.

      AFAICT all versions are affected (just checked svn trunk).

      Attachments

        Activity

          People

            lukaszlenart Lukasz Lenart
            davidlmansfield David Mansfield
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified