簡體   English   中英

@RequestMapping 沒有 @Controller 注釋

[英]@RequestMapping without @Controller annotation

Is it possible to use @RequestMapping annoation in controller class without the use of @Controller annotation for controller class i will register the bean i am asking this coz @Controller class if i deploy as jar file it not working properly so any help?

您需要<context:component-scan base-package="com.yourpackage" />來激活注釋。

至於問題 - 您的 bean 應該是 controller 以便有資格進行請求映射。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM