I am fairly new in Spring Boot and trying to build a simple web app. I have defined a controller class containing my mapping for url, but on browser it is giving me a white
The BmsApplication
class is placed under the com.wellmanage.bms
package and by default the @SpringBootApplication
annotation runs component scan using this package as the root. Since the BookController
is inside com.wellmanage.controller
, the package is omitted by default configuration.
You have two options:
@ComponentScan("com.wellmanage")
@SpringBootApplication
public class BmsApplication {
public static void main(String[] args) {
SpringApplication.run(BmsApplication.class, args);
}
}
com.wellmanage
.From the configuration you have posted, it seems you didn't set any template engine. Returning the String "abc" from your controller is hence ignored.