Struts 2 + Spring 4 を使用しており、Struts 2 アクションを管理するためにスプリングをセットアップしたいと考えています。
Spring Bean はアノテーションによって定義されます。
struts.xml
struts アクションはコンベンション プラグインで配置されているため、ファイルにアクションはありません。
アクションは以下のとおりです。
//It is located in action folder so it will be located by convention plugin
package foo.bar.actions.usermanager
@Named //This will be used by Spring to located and manage this Bean
public class EditUser(){
@Action(className="editUser") // Should I defined class name here ?!
public String execute() {
}
}
上記のコードは機能します。しかし、より良い方法があるかどうかを探しているので、className を省略できます (これはまさにアクション名のキャメル変換です)。
出来ますか?!