Leave a Reply

12 Comments on "Spring Boot Quick Start 11 – Adding a REST Controller"

Notify of
avatar

bbvkishore
Guest
bbvkishore
2 days 15 hours ago

For those whom it worked .. How did this work without adding @ComponentScan("io.javabrains")? At least, it didn't work until I added that 🙁

sumanth varada
Guest
sumanth varada
25 days 9 hours ago

Hi Kaushik, Thanks for this wonderful tutorial. I can't see the tomcat running in my console. Can u help me ??

Lionel Kamdem
Guest
Lionel Kamdem
15 days 12 hours ago

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!

Skullid13
Guest
Skullid13
28 days 8 hours ago

thanks Rajesh for this tutorial

Yuanzhi Bao
Guest
Yuanzhi Bao
1 month 14 days ago

Thank you! Great videos!

Arpan Sharma
Guest
Arpan Sharma
1 month 18 days ago

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.

Abhishek Ekaanth
Guest
Abhishek Ekaanth
1 month 24 days ago

ty for this video its really helpful 🙂 Great thumbsUP 🙂

Alex Peng
Guest
Alex Peng
1 month 26 days ago

what's the JAX-RS Reference Implementation used in this tutorial ?

Sachin Hadke
Guest
Sachin Hadke
1 month 26 days ago

Thanks for posting nice tutorial.One thing is not coming out clearly from this video is how auto scanning of @RestController and other inner annotations are resolved. From my understanding, spring auto scan start from classes in package where @SpringBootConfiguration is defined and that include classes in sub-packages of @SpringBootConfiguration class. That is the reason why HelloController is written inside springbootstarter.hello sub package.

cdhagen
Guest
cdhagen
3 months 3 days ago

It's not correct that @RequestMapping only maps to GET when no RequestMethod is specified. Instead, it will map to all HTTP methods. You can try by running a DELETE against localhost:8080/topics/ and it will still give you the list of topics – which makes a kinda weird API. So I guess, best practice would be to always specify the RequestMethod.

Java Brains
Guest
Java Brains
3 months 3 days ago

Thanks for catching this! You are right. I'll add an annotation to the video with the correction.

Maik Lempik
Guest
Maik Lempik
3 months 3 days ago

Totally right. At this point I used this kind of annotation for the GET Method instead@RequestMapping(value="/hello", method = RequestMethod.GET)

wpDiscuz