开发者

Delegating Struts action class management to Spring raises MTIA critical voilation in Findbugs

开发者 https://www.devze.com 2022-12-28 06:21 出处:网络
When i use \"Delegate Struts Action management to Spring\" approach explained in http://www.ibm.com/developerworks/java/library/j-sr2.html#N101B7

When i use "Delegate Struts Action management to Spring" approach explained in http://www.ibm.com/developerworks/java/library/j-sr2.html#N101B7 things work fine in terms of functionality but findbugs reports following voilation Dodgy - Class开发者_如何学C extends Struts Action class and uses instance variables:MTIA

I have bean dependencies injected into action class through spring .

Please help me and suggest me a cleaner way to solve this problem.

Thanks


This is just an misunderstanding with findbugs. FindBugs sees the injector setter methods and assumes that these can be called during the normal flow of the action. If that were the case, then the action would be problematic. However since these methods are only used at startup, it's not an issue. You can exclude this warnings from FindBugs if they are bothering you.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号