当前位置:网站首页>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
边栏推荐
猜你喜欢

想从手工测试转岗自动化测试,需要学习哪些技能?

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

Ambiguous method call.both

Use of QML

Database implements distributed locks

LocalDate加减操作及比较大小

端口排查步骤-7680端口分析-Dosvc服务

STM32 problem collection

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

《DeepJIT: An End-To-End Deep Learning Framework for Just-In-Time Defect Prediction》论文笔记
随机推荐
Several common errors when using MP
C语言从入门到如土——数据的存储
TCP和UDP详解
web容器及IIS --- 中间件渗透方法1
The distance value between two arrays of LeetCode simple questions
IIR filter and FIR filter
False positives and false negatives in testing are equally worthy of repeated corrections
Getting Started with CefSharp - winform
els 方块向右移动边界判断、向下加速
下载jar包的好地方
【AUTOSAR-RTE】-4-Port和Interface以及Data Type
递归查询单表-单表树结构-(自用)
Component pass value provide/inject
$attrs/$listeners
QML的使用
[Compilation principle] Design principle and implementation of recursive descent parsing
$parent/$children 与 ref
《DeepJIT: An End-To-End Deep Learning Framework for Just-In-Time Defect Prediction》论文笔记
浅识Flutter 基本组件之showDatePicker方法
Safety 20220712
