[ 
https://issues.apache.org/jira/browse/WW-3460?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Patrick Savage updated WW-3460:
-------------------------------

    Attachment: WW-3460.patch

The change implemented in this issue prevents Struts from finding Spring beans 
that do not have an "id" set (typical for actions, interceptors, etc.). The 
containsBeanDefinition method returns false when the bean's class name is 
passed into it because the bean definition id is actually the class name plus 
"#0". There is an alias from the class name to the bean definition id, but 
containsBeanDefinition ignores that alias. 

The solution is to use the containsBean method instead of 
containsBeanDefinition. This resolves the alias to the real bean definition id 
and so it is able to find the bean. Please apply the attached patch to fix this 
problem.

> Use look-before-you-leap strategy for creating Spring beans vs Struts objects
> -----------------------------------------------------------------------------
>
>                 Key: WW-3460
>                 URL: https://issues.apache.org/jira/browse/WW-3460
>             Project: Struts 2
>          Issue Type: Improvement
>          Components: Plugin - Spring
>    Affects Versions: 2.1.6
>            Reporter: Leigh Anderson
>            Assignee: Lukasz Lenart
>             Fix For: 2.2.3
>
>         Attachments: WW-3460.patch, spring-plugin.patch
>
>
> 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. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to