1
我们使用的是Struts 2 + Spring 4,并且我们想设置spring来管理我们的struts 2动作。用弹簧管理struts动作(按惯例插件配置)
春豆由注释定义。
struts操作与convention插件位于同一位置,所以我们在struts.xml
文件中没有任何操作。
的行动是如下:
//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(这正是骆驼转换的动作名称)
可能吗?!