Leave a Reply

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

Notify of
avatar

Антон Куликов
Guest
Антон Куликов
22 days 17 hours ago

1st lesson he says springboot is not for "Hello World" application2nd lesson he did "Hello World" application…fk the logic

pranadheer reddy
Guest
pranadheer reddy
1 month 1 day ago

if tomcat error occurs follow my stepsgo to command prompt and type netstat -anothen you will get list of all ipaddress with your ports find 8080 port which will be appended somewhere to ur ip and get its process id which is PID (a number) lets assume my PID is 5488.and then type taskkill -pid 5488/frestart your app and run it again hope this works for you!

pranadheer reddy
Guest
pranadheer reddy
23 days 20 hours ago

😀

Sumeet Gaur
Guest
Sumeet Gaur
23 days 23 hours ago

It worked. Thanks a lot!

Tecnitr0nic
Guest
Tecnitr0nic
1 month 6 days ago

I am using only the @Controller annotation. What is the difference with the @RestController? For me is working just fine.

mansi goel
Guest
mansi goel
1 month 12 days ago

hi,for beginners one thing is important:Controller will only work if it is the part of main class. Example : if main class is in 'package1' and controller is in 'package2', then it won't work.. so controller must be in 'package1.anyname'

Kaushik Lele
Guest
Kaushik Lele
4 months 6 hours ago

@springbootapplication @ComponentScan(basePackages = "<basepackage>) Without this annotation the example does not work. Please add this to your video. ….. other solution to omit this annotation is to keep application class in a root packageabove other classes as mentioned in springboot documentation here docs.spring.io/spring-boot/docs/current/reference/html/using-boot-structuring-your-code.html

Varun Kumar
Guest
Varun Kumar
24 days 11 hours ago

For me strange thing happend: "in one of the maven project @ComponentScan worked, after few trials.For another spring project I had to give arguments (basePackages="<basepackage>").

Varun Kumar
Guest
Varun Kumar
25 days 15 hours ago

@ComponentScanFor me just the plain annotation worked, without (basePackages="<basepackage>") argument.

golokesh patra
Guest
golokesh patra
4 months 5 days ago

Hello, I have used jackson object mapper to convert JSON into a java object. But I want to to show this object in my browser. How should i do it ?

Sugam Shende
Guest
Sugam Shende
5 months 4 hours ago

Description Resource Path Location TypeArchive for required library: 'C:/Users/HP/.m2/repository/org/hibernate/hibernate-validator/5.2.4.Final/hibernate-validator-5.2.4.Final.jar' in project 'course-api' cannot be read or is not a valid ZIP file course-api Build path Build Path ProblemSir please may i known how to resolve this problem

Marinakulichok
Guest
Marinakulichok
5 months 1 day ago

If some one have the same error as me "The Tomcat connector configured to listen on port 8080 failed to start. The port may already be in use or the connector may be misconfigured." This is a port conflict , my programm is still running and I tried to run it again.Always normally terminate your "run" red buttone closed to "console" then rerun your project! It have to help

pranadheer reddy
Guest
pranadheer reddy
1 month 1 day ago

mmm this error happens because 8080 is used by our old programs there is a simple solution for it go to command prompt and type netstat -anothen you will get list of all ipaddress with your ports find 8080 port which will be appended somewhere to ur ip and get its process id which is PID (a number) lets assume my PID is 5488.and then type taskkill -pid 5488/frestart your app and run it again hope this works for you!

surya m
Guest
surya m
2 months 3 days ago

Thankyou 🙂

krishna chaitanya
Guest
krishna chaitanya
5 months 3 days ago

Kaushik, a bit off topic question. whats the keyboard that you are using. love the sound of the keypress.

Ashutosh Sharma
Guest
Ashutosh Sharma
6 months 12 days ago

@RequestMapping is not working on for me. Tomcat started successfully but not able to see any response on browser.

Kaushik Lele
Guest
Kaushik Lele
4 months 6 hours ago

@springbootapplication @ComponentScan(basePackages = "<basepackage>) Without this annotation the example does not work. Other solution to omit this annotation is to keep application class in a root packageabove other classes as mentioned in springboot documentation here docs.spring.io/spring-boot/docs/current/reference/html/using-boot-structuring-your-code.html

Anand Bharti
Guest
Anand Bharti
4 months 3 days ago

Thanks alot

Chris Jacobs
Guest
Chris Jacobs
4 months 5 days ago

You're the real MVP

Emre Verim
Guest
Emre Verim
6 months 2 days ago

add this under @springbootapplication @ComponentScan(basePackages = "<basepackage>)basepackage should be the package which you have your Restcontroller.

Emre Verim
Guest
Emre Verim
6 months 2 days ago

same issue here, if i can fix it up, i will post it

1 2 3
wpDiscuz