spring的注解都有哪些,能详细的说一下吗?

如题所述

Controller 该类为Controller

RequestMapping 配置方法路径等信息
ResponseBody 返回值,例如JSON,XML
PathVariable 获取RESTFUL路径中的值如 /company/{corpId}/dept/{deptId}
RequestParam 获取Request参数值如xxx?from=index_nav

Component,Repository,Service

一般dao用Repository,service用Service,需要多个service时,一般用Componet

@Component
public class AComponent {
...
public void xxx() {
serviceA.a();
serviceB.b();

...

serviceN.n();

}
}
温馨提示:答案为网友推荐,仅供参考
相似回答