Access the full course here: javabrains.io/courses/spring_bootquickstart
Learn how to create a new REST endpoint by creating a brand new Spring MVC controller.
24 Comments on "Spring Boot Quick Start 11 – Adding a REST Controller"
@RequestMapping is not working on for me. Tomcat started successfully but not able to see any response on browser.
add this under @springbootapplication @ComponentScan(basePackages = "<basepackage>)basepackage should be the package which you have your Restcontroller.
same issue here, if i can fix it up, i will post it
Hi, Kaushik I am just wondering how the view resolver worked here? Does Spring boot sets default view resolver?
Same problem to me. Please give me a solution if you solved the issue
For those whom it worked .. How did this work without adding @ComponentScan("io.javabrains")? At least, it didn't work until I added that 🙁
Hi Kaushik, Thanks for this wonderful tutorial. I can't see the tomcat running in my console. Can u help me ??
that works like a charm…..
In your ApplicationStarter(where you have added SpringBootApplication annotation) class add @ComponentScan(basePackages = "<basepackage>"), in place of <basepackage> put package of TestController or put a parent package so that everything is scanned..after that it should work..
Angshuman Dey try to change the port number and start again!
Thanks Worked like a gem 🙂
Try to create the "Application.properties" file in src/main/resources and add try to change you embedded tomcat server port by adding these lines into the Application.properties file: 1. logging.level.org.springframework: DEBUG2. server.port=8282Run again your project and try: localhost:8282/hello. Hope I helped!
thanks Rajesh for this tutorial
Thank you! Great videos!
Great work boss!!😀Instead of RequestMapping we can use @GetMapping and @PostMapping directly for the Get and Post request respectively.+1 if anybody find it useful.
ty for this video its really helpful 🙂 Great thumbsUP 🙂
what's the JAX-RS Reference Implementation used in this tutorial ?
In CodeChannels.com, you can learn to code by watching videos and stay up to date with latest code shows, events and tutorials aggregated from various leading developer communities.
Copyright 2016 By CodeChannels.com All rights reserved.