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

Use TextProviderFactory instead of TextProvider as bean's dependency

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.5.10
    • Fix Version/s: 2.5.12
    • Component/s: Core
    • Labels:
      None

      Description

      Right now a TextProvider interface is implemented by the ActionSupport class which can be misleading and hard to distinguish as bean when it comes to injecting a proper implementation (e.g. using Spring).

      Separating the TextProvider interface from how it is built should solve the problem.

        Issue Links

          Activity

          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user lukaszlenart opened a pull request:

          https://github.com/apache/struts/pull/123

          WW-4756: Introduce TextFactoryProvider

          This PR introduces a dedicated interface `TextProviderFactory` with a default implementation to allow easier further customisations by users.

          Implements WW-4756(https://issues.apache.org/jira/browse/WW-4756)

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/lukaszlenart/struts text-provider-factory

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/struts/pull/123.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #123


          commit 4f46f151844bcef39cd631a6fb1cd781fd34224a
          Author: Lukasz Lenart <lukaszlenart@apache.org>
          Date: 2017-03-16T13:39:06Z

          Adds missing class header with license

          commit 9376bb0ca16595cac0a1d03fb7b4fa55ab66a8f3
          Author: Lukasz Lenart <lukaszlenart@apache.org>
          Date: 2017-03-16T13:43:07Z

          Renames TextProviderFactory into StrutsTextProviderFactory

          commit 54974223fa1f6a66d8c1d61b7b18c94ef5c50386
          Author: Lukasz Lenart <lukaszlenart@apache.org>
          Date: 2017-03-16T13:55:35Z

          Extracts TextProviderFactory interface

          commit 3b73544a8ff5e9d96885147bf25c7c2598ac6b21
          Author: Lukasz Lenart <lukaszlenart@apache.org>
          Date: 2017-03-17T06:49:33Z

          Uses existing instance instead of creating a new one

          commit 207ac1774439f72cdfab32c45a3c59ba5a972899
          Author: Lukasz Lenart <lukaszlenart@apache.org>
          Date: 2017-03-17T06:51:12Z

          Defines proper interfaces and default implementation in configuration

          commit 16d1d60ed826c639d2298b77b27c184d9684f21c
          Author: Lukasz Lenart <lukaszlenart@apache.org>
          Date: 2017-03-17T06:51:57Z

          Uses dedicated logger instead the one from parent class

          commit 944b1a2303536023973456d6685f9ab86a775cb0
          Author: Lukasz Lenart <lukaszlenart@apache.org>
          Date: 2017-03-17T06:59:50Z

          Injects proper dependencies into tag

          commit ee6c927db6663741c3d0179e16687704359ea40c
          Author: Lukasz Lenart <lukaszlenart@apache.org>
          Date: 2017-03-17T07:02:24Z

          Drops unavailable dependency

          commit c039685cf946f5e9864ae175a14f3ccdc0edbe59
          Author: Lukasz Lenart <lukaszlenart@apache.org>
          Date: 2017-03-17T07:02:52Z

          Moves bean into same area are other releated to it beans

          commit 132829cc244d60692e3547c5c40b72e29eea1a9e
          Author: Lukasz Lenart <lukaszlenart@apache.org>
          Date: 2017-03-17T07:03:28Z

          Defines bean in test configuration

          commit e8a598c7bc83752f488ad4ccccd0d11a64df3f03
          Author: Lukasz Lenart <lukaszlenart@apache.org>
          Date: 2017-03-17T07:03:48Z

          Updates test to use the new injectable factory


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user lukaszlenart opened a pull request: https://github.com/apache/struts/pull/123 WW-4756 : Introduce TextFactoryProvider This PR introduces a dedicated interface `TextProviderFactory` with a default implementation to allow easier further customisations by users. Implements WW-4756 ( https://issues.apache.org/jira/browse/WW-4756 ) You can merge this pull request into a Git repository by running: $ git pull https://github.com/lukaszlenart/struts text-provider-factory Alternatively you can review and apply these changes as the patch at: https://github.com/apache/struts/pull/123.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #123 commit 4f46f151844bcef39cd631a6fb1cd781fd34224a Author: Lukasz Lenart <lukaszlenart@apache.org> Date: 2017-03-16T13:39:06Z Adds missing class header with license commit 9376bb0ca16595cac0a1d03fb7b4fa55ab66a8f3 Author: Lukasz Lenart <lukaszlenart@apache.org> Date: 2017-03-16T13:43:07Z Renames TextProviderFactory into StrutsTextProviderFactory commit 54974223fa1f6a66d8c1d61b7b18c94ef5c50386 Author: Lukasz Lenart <lukaszlenart@apache.org> Date: 2017-03-16T13:55:35Z Extracts TextProviderFactory interface commit 3b73544a8ff5e9d96885147bf25c7c2598ac6b21 Author: Lukasz Lenart <lukaszlenart@apache.org> Date: 2017-03-17T06:49:33Z Uses existing instance instead of creating a new one commit 207ac1774439f72cdfab32c45a3c59ba5a972899 Author: Lukasz Lenart <lukaszlenart@apache.org> Date: 2017-03-17T06:51:12Z Defines proper interfaces and default implementation in configuration commit 16d1d60ed826c639d2298b77b27c184d9684f21c Author: Lukasz Lenart <lukaszlenart@apache.org> Date: 2017-03-17T06:51:57Z Uses dedicated logger instead the one from parent class commit 944b1a2303536023973456d6685f9ab86a775cb0 Author: Lukasz Lenart <lukaszlenart@apache.org> Date: 2017-03-17T06:59:50Z Injects proper dependencies into tag commit ee6c927db6663741c3d0179e16687704359ea40c Author: Lukasz Lenart <lukaszlenart@apache.org> Date: 2017-03-17T07:02:24Z Drops unavailable dependency commit c039685cf946f5e9864ae175a14f3ccdc0edbe59 Author: Lukasz Lenart <lukaszlenart@apache.org> Date: 2017-03-17T07:02:52Z Moves bean into same area are other releated to it beans commit 132829cc244d60692e3547c5c40b72e29eea1a9e Author: Lukasz Lenart <lukaszlenart@apache.org> Date: 2017-03-17T07:03:28Z Defines bean in test configuration commit e8a598c7bc83752f488ad4ccccd0d11a64df3f03 Author: Lukasz Lenart <lukaszlenart@apache.org> Date: 2017-03-17T07:03:48Z Updates test to use the new injectable factory
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit 350c77aba8776bec0c11ebdd6e331cb6028e0972 in struts's branch refs/heads/master from Lukasz Lenart
          [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=350c77a ]

          WW-4756 Implements TextProviderFactory and used it accros the framework

          Show
          jira-bot ASF subversion and git services added a comment - Commit 350c77aba8776bec0c11ebdd6e331cb6028e0972 in struts's branch refs/heads/master from Lukasz Lenart [ https://git-wip-us.apache.org/repos/asf?p=struts.git;h=350c77a ] WW-4756 Implements TextProviderFactory and used it accros the framework
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/struts/pull/123

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/struts/pull/123
          Hide
          lukaszlenart Lukasz Lenart added a comment -
          Show
          lukaszlenart Lukasz Lenart added a comment - PR got merged, also added an example app https://github.com/apache/struts-examples/tree/master/text-provider

            People

            • Assignee:
              lukaszlenart Lukasz Lenart
              Reporter:
              lukaszlenart Lukasz Lenart
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development