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

Use look-before-you-leap strategy for creating Spring beans vs Struts objects

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.1.6
    • 2.2.3
    • Plugin - Spring
    • None
    • Patch

    Description

      For our use case with struts actions and validators, each page request resulted in the SpringObjectFactory.buildBean() method being called multiple times for the validator beans which were known ahead of time not to be spring-managed. This results in an exception being thrown and caught – effectively using exceptions as flow control. The attached patch checks the Spring context before delegating the bean creation.

      In our tests, this resulted in a reduction in both CPU use and request latency.

      Attachments

        1. WW-3460.patch
          0.8 kB
          Patrick Savage
        2. spring-plugin.patch
          1 kB
          Leigh Anderson

        Activity

          People

            lukaszlenart Lukasz Lenart
            bravesirrobin Leigh Anderson
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: