当前位置:网站首页>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
边栏推荐
- C primer plus study notes - 8, structure
- Ambiguous method call.both
- 【C语言】预处理操作
- 《DeepJIT: An End-To-End Deep Learning Framework for Just-In-Time Defect Prediction》论文笔记
- PMP WeChat group daily exercises
- [Compilation principle] Lexical analysis program design principle and implementation
- Ambiguous method call.both
- 顺序表的实现
- STM32 problem collection
- [C language] General method for finding the sum of the greatest common factor and the least common multiple of two integers m and n, the classical solution
猜你喜欢

7年经验,功能测试工程师该如何一步步提升自己的能力呢?

The application and practice of mid-to-platform brand advertising platform

Just debuted "Fight to Fame", safety and comfort are not lost

Zotero如何删除自动生成的标签

分布式系统架构需要解决的问题

SIP协议标准和实现机制

识Flutter 基本组件之showTimePicker 方法

No qualifying bean of type 问题

【C语言】预处理操作

LeetCode simple problem to find the subsequence of length K with the largest sum
随机推荐
els block to the right
BP神经网络
Daily practice of LeetCode - palindrome structure of OR36 linked list
Good place to download jar packages
Redis counts new and retained users
Annotation usage meaning
C# remote debugging
Based on the local, linking the world | Schneider Electric "Industrial SI Alliance" joins hands with partners to go to the future industry
The Map Entry understanding and application
TCP详解(一)
Difference between unallocated blocks and unused blocks in database files
How to develop a high-quality test case?
LeetCode simple problem to find the subsequence of length K with the largest sum
分布式系统架构需要解决的问题
Day32 LeetCode
【C语言】预处理操作
Problems that need to be solved in distributed system architecture
endian mode
VS QT - ui does not display newly added members (controls) || code is silent
CloudCompare&PCL 计算两个点云之间的重叠度
