1 when the startup class and controller are in the same class, add the annotation @controller in the class
2 when the startup class and controller are separated, the startup class should be placed in the root directory of the project, add the annotation @springbootapplication in the startup class,
2 when the startup class and controller are separated, the startup class should be placed in the root directory of the project, and add the annotation @componentscan in the startup class, And configure the package name to be scanned (basePackages=)
the second option is generally recommended
The project structure
startup class DemoProjectApplication
Read More:
- Error: php56w-common conflicts with php-common-5.3.3-48.el6_ 8.x86_ 64
- [Solved] Android Gradle configure error: Location: Class buildconfig
- Could not write JSON: write javaBean error, fastjson version x.x.x, class
- 【PTA:】 Error: class X is public should be declared in a file named X.java
- 0xc0000005: an access conflict occurred while reading location 0x00000020
- Unhandled exception: 0xc0000005: access violation while reading location 0x00000000
- Memory error unhandled exception: 0xc0000005: read location: 0x00000
- Three possibilities of “unhandled exception: 0xc0000005: access conflict when reading location 0x00000000”
- Opencv: 0xc0000005: an access conflict occurred while reading location 0x0000000010
- Bug resolution of 0xc0000005: access conflict occurred when reading location of 0x00000000.
- The springboot test class reported an error NullPointerException
- Spring boot integrates Mongo to solve some common connection and permission problems. Docker compose installs Mongo
- Solution to the problem of spring boot running test class error creating bean with name ‘serverendpoint exporter’ defined
- Error: (21,13) Java: symbol not found: class order location: interface mapper.ordermapper
- RuntimeError: Expected hidden[0] size (x, x, x), got(x, x, x)
- [Solved] emulator: glteximage2d: got err pre 🙁 0x502 internal 0x1908 format 0x1908 type 0x1401
- Add PageHelper spring boot starter dependency to springboot and report an error
- 0xc0000005: solution to access conflict when writing to location 0x00000000
- There is an unhandled exception at: 0xc0000005: an access conflict occurred while reading location 0x00000000.
- C / C + + error handling (document): unhandled exception: 0xc0000005: access violation while reading location 0x00000000