当前位置:网站首页>No qualifying bean of type question
No qualifying bean of type question
2022-07-31 03:33:00 【UlricaQ】
Article table of contents
No qualifying bean of type problem solving ideas
To solve the problem of No qualifying bean of type, there are currently two reasons for the error:
- Annotations
- Configuration (scanning packages, nacos, class names, etc.)
1. Comments
- Check if the annotations corresponding to controller, service and mapper are correct
- Such as: @Controller @Service @Component @Repository
2. Configuration
1. Configure whether nacos is used, and you need to configure database information, etc.
2. Whether the scan package is used

or use @MapperScan(value="com.*** ")
Annotation Extension
- what: special tag in code
- where: can be placed on a method or a class
1. How does the front-end code link use annotations?
- If the annotation is on the method, you can write the annotation of the method in the link

- If the annotation is on the class, you need to write the annotation of the class + method in the link

2. Annotation attribute:
- path: Specifies the requested URL
- (commonly used) value has the same function as path, you can add a path, use value can be omitted, just write the path directly
- (commonly used) method: specify the request method of this method
- headers: Specify conditions to limit request headers-
- params: conditions for restricting request parameters
– the key and value are the same
– case 1: only limit the parameters passed, not what the parameters are specific
– case 2: the parameters must be consistent
3. Common Notes
@RequestParam
- Role: Assign the parameter with the specified name in the request to the formal parameter in the controller
- Attribute:
–value: parameter name
–required: whether this parameter must be filled in - Example

@RequestBody
- Role: used to get the content of the request body
- Attribute: required
- Scope: Asynchronous (used when asynchronous)
- Example

@PathVariable
- Function: placeholder for binding url
li> - Benefits: restful programming style
- The original way – add the root path to each path

- restful method: use get, post, put to distinguish the path
–localhost:8080/user/10 get——this is the http request indicating that the request method is get and the parameter id
@RequestHeader: not commonly used
@CookieValue
- Role: Pass the value of the specified cookie name into the controller method parameter
@ModelAttribute
- Function: Modify methods and parameters
- how: This modification is executed first
@SessionAttributes
- Function: used for parameter sharing between multiple execution controller methods
- attributes
–value
–type-stored data type
边栏推荐
- Daily practice of LeetCode - palindrome structure of OR36 linked list
- Distributed locks and three implementation methods
- Pytest e-commerce project combat (on)
- 一份高质量的测试用例如何养成?
- Use of QML
- 立足本土,链接全球 | 施耐德电气“工业SI同盟”携手伙伴共赴未来工业
- 【CocosCreator 3.5】CocosCreator 获取网络状态
- 【AUTOSAR-RTE】-4-Port和Interface以及Data Type
- 【异常】The field file exceeds its maximum permitted size of 1048576 bytes.
- 【Cocos Creator 3.5】缓动系统停止所有动画
猜你喜欢

C语言从入门到如土——数据的存储

Mysql 45 study notes (twenty-four) MYSQL master-slave consistency

「 每日一练,快乐水题 」1331. 数组序号转换

A brief introduction to the CheckBox component of the basic components of Flutter

postgresql 15源码浅析(5)—— pg_control

Ambiguous method call.both

5. How does the SAP ABAP OData service support the $filter operation

What skills do I need to learn to move from manual testing to automated testing?

一份高质量的测试用例如何养成?

Redis implements distributed locks
随机推荐
type_traits元编程库学习
顺序表的实现
TCP详解(三)
Mysql 45 study notes (23) How does MYSQL ensure that data is not lost
LocalDate加减操作及比较大小
【C语言】预处理操作
Daily practice of LeetCode - palindrome structure of OR36 linked list
How to develop a high-quality test case?
Atomic operation CAS
Based on the local, linking the world | Schneider Electric "Industrial SI Alliance" joins hands with partners to go to the future industry
els 方块向左移动条件判断
TCP详解(一)
MP使用时的几个常见报错
(树) 最近公共祖先(LCA)
LeetCode simple problem to find the subsequence of length K with the largest sum
Redis 使用LIST做最新评论缓存
With 7 years of experience, how can functional test engineers improve their abilities step by step?
SIP Protocol Standard and Implementation Mechanism
端口排查步骤-7680端口分析-Dosvc服务
els block to the right
