【发布时间】:2014-03-26 13:09:28
【问题描述】:
我们正在使用 Struts 2 + Spring 4,我们想设置 spring 来管理我们的 struts 2 动作。
spring bean 是由注解定义的。
struts 动作位于约定插件中,因此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 (这正是动作名称的骆驼转换)
有可能吗?!
【问题讨论】:
标签: java spring struts2 spring-annotations struts2-convention-plugin