spring註解詳解與用法(總覽)

這篇文章收集了我寫的所有的spring註解的詳細說明與用法,點擊可以跳轉到對應文章,此文章會不斷更新

spring註解詳解與用法(1)最基礎也是最常見的如下所示,詳情點擊這裏

@Controller//控制層
@RestController//控制層
@RequestMapping//url映射
@Service//服務
@Reponsitory//數據層
@DAO//數據層
@Component//配置
@Autowired//資源獲取
@Configuration//凝視
@ComponentScan//掃描

spring註解詳解與用法(2)Bean依賴注入相關,詳情點擊這裏

@Bean//依賴注入

spring註解詳解與用法(3)環繞相關如下所示,詳情點擊這裏

@EnableAspectJAutoProxy//通知spring啓用環繞功能
@Aspect//配置環繞
@Before//前置環繞
@Around//前後環繞
@After//後置環繞
@Pointcut//切入點
@AfterReturning//獲取返回值的後置環繞
@AfterThrowing//異常環繞

spring註解詳解與用法(4)異步如下所示,詳情點擊這裏

@EnableAsync//異步類
@Async//異步方法

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章