Return-Path: Delivered-To: apmail-struts-issues-archive@locus.apache.org Received: (qmail 475 invoked from network); 13 Jun 2008 02:20:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Jun 2008 02:20:29 -0000 Received: (qmail 94231 invoked by uid 500); 13 Jun 2008 02:20:29 -0000 Delivered-To: apmail-struts-issues-archive@struts.apache.org Received: (qmail 93805 invoked by uid 500); 13 Jun 2008 02:20:28 -0000 Mailing-List: contact issues-help@struts.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@struts.apache.org Delivered-To: mailing list issues@struts.apache.org Received: (qmail 93784 invoked by uid 99); 13 Jun 2008 02:20:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 12 Jun 2008 19:20:28 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 13 Jun 2008 02:19:47 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 56F5F234C13E for ; Thu, 12 Jun 2008 19:20:05 -0700 (PDT) Message-ID: <658065295.1213323605355.JavaMail.jira@brutus> Date: Thu, 12 Jun 2008 19:20:05 -0700 (PDT) From: "Don Brown (JIRA)" To: issues@struts.apache.org Subject: [jira] Updated: (WW-2558) Spring plugin can't find Action classes configured by Spring 2.5 annotations In-Reply-To: <356415764.1205877718794.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/struts/browse/WW-2558?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Don Brown updated WW-2558: -------------------------- Fix Version/s: 2.2.x > Spring plugin can't find Action classes configured by Spring 2.5 annotations > ---------------------------------------------------------------------------- > > Key: WW-2558 > URL: https://issues.apache.org/struts/browse/WW-2558 > Project: Struts 2 > Issue Type: Improvement > Components: Plugin - Spring > Affects Versions: 2.0.11.1 > Reporter: Brad Cupit > Priority: Trivial > Fix For: 2.2.x > > > The Spring plugin looks up Spring beans based on the fully qualified class name, and doesn't find Spring-managed Action classes configured by Spring annotations. (Spring 2.5 can automatically find annotated beans instead of using xml config). These annotated beans have short bean names, meaning "object" instead of java.lang.Object > Instead, the Spring plugin instantiates the bean itself and follows the autowire policy, but the bean is not managed by Spring. > Ultimate Goal: > Be able to use the Spring annotation config and the Struts Codebehind plugin to eliminate xml configuration in Struts and Spring, and yet still have Actions be fully Spring managed. > There are three current workarounds: > 1) let the Spring plugin instantiate and autowire Actions as it does now, but can't use any AOP features for those Actions > 2) configure the bean in struts.xml and provide the 'short' bean name as the class name > 3) configure the bean in a spring xml file and don't specify an id (the default id is the fully qualified class name) > None of these workarounds provide the ultimate goal of zero xml configuration and full Spring integration. > Proposed fix: > Alter the Spring plugin to lookup the bean based on type instead of using the class as the bean name. It could use ListableBeanFactory#getBeansOfType(), and throw an exception if there is more than one bean for that Action class. This could be configurable by a Struts constant (like "struts.objectFactory.spring.lookup" whose values could be "byClass" or "byName"). The changes could go in SpringObjectFactory#buildBean(String, Map, boolean) -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.