[英]@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? 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?
You need <context:component-scan base-package="com.yourpackage" />
to activate annotations.您需要
<context:component-scan base-package="com.yourpackage" />
来激活注释。
As for the question - your bean should be a controller in order to be eligible for request mapping.至于问题 - 您的 bean 应该是 controller 以便有资格进行请求映射。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.