Login

Language :
Titlespring boot controller 404
spring boot controller 404
Writer이지섭Write DateJul 2 2024Modify DateJul 29 2024View Count569
If Spring Boot calls the address you mapped to the controller and gets a 404, 
 
You can handle this in one of two ways
 
 
1) You can add a ComponentScan annotation to directly specify which packages to scan.
 
@SpringBootApplication
@ComponentScan(basePackages = {"com.example", "com.test"})
 
 
2) Place the controller under the Spring Boot main application's package.
 
If the Spring Boot main application's package is com.example.demo,
you would set the controller's package to be subordinate to com.example.demo.

 

Comment

Name               Password 
Content
Check Password.

Please enter your password when registering your comment.