Leave a Reply

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

Notify of
avatar

Ashutosh Sharma
Guest
Ashutosh Sharma
18 days 9 hours ago

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

xyxsopme 33
Guest
xyxsopme 33
8 days 6 hours ago

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

xyxsopme 33
Guest
xyxsopme 33
8 days 6 hours ago

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

Angshuman Dey
Guest
Angshuman Dey
24 days 2 hours ago

Hi, Kaushik I am just wondering how the view resolver worked here? Does Spring boot sets default view resolver?

Uttam Patra
Guest
Uttam Patra
26 days 8 hours ago
Hi kaushik, I am not able to see tomcat in the console2017-03-30 13:41:51.059 INFO 14820 — [ main] com.ukp.springbootstarter.CourseApiApp : Starting CourseApiApp on BDC4A-L-6440LBB with PID 14820 (C:uttamMyDemosSpringBootws1course-apitargetclasses started by uttam.patra.kumar in C:uttamMyDemosSpringBootws1course-api)2017-03-30 13:41:51.066 INFO 14820 — [ main] com.ukp.springbootstarter.CourseApiApp : No active profile set, falling back to default profiles: default2017-03-30 13:41:51.212 INFO 14820 — [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@769f71a9: startup date [Thu Mar 30 13:41:51 IST 2017]; root of context hierarchy2017-03-30 13:41:55.404 INFO 14820 — [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup2017-03-30 13:41:55.649 INFO 14820 — [ main] com.ukp.springbootstarter.CourseApiApp : Started CourseApiApp in 5.666… Read more »
Shyam Rao Singham
Guest
Shyam Rao Singham
19 days 10 hours ago

Same problem to me. Please give me a solution if you solved the issue

bbvkishore
Guest
bbvkishore
28 days 5 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
1 month 20 days ago

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

Angshuman Dey
Guest
Angshuman Dey
16 days 18 hours ago

that works like a charm…..

Ekta Dubey
Guest
Ekta Dubey
16 days 19 hours ago

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
Guest
Angshuman Dey
20 days 8 hours ago
Hi Vaibhav,Did that but no success. Same thing is happening. Don't know what's wrong with my code it's really very frustrating.localhost:8282/firstTestController class—————————-@RestControllerpublic class TestController { @RequestMapping("/firstTest") public String springBootFirstTest(){ return "THIS IS MY FIRST SPRING BOOT APPLICATION"; }}Log output———————2017-04-05 12:53:09.389 DEBUG 5320 — [nio-8282-exec-1] o.s.web.servlet.DispatcherServlet : DispatcherServlet with name 'dispatcherServlet' processing GET request for [/firstTest]2017-04-05 12:53:09.392 DEBUG 5320 — [nio-8282-exec-1] s.w.s.m.m.a.RequestMappingHandlerMapping : Looking up handler method for path /firstTest2017-04-05 12:53:09.396 DEBUG 5320 — [nio-8282-exec-1] s.w.s.m.m.a.RequestMappingHandlerMapping : Did not find handler method for [/firstTest]2017-04-05 12:53:09.396 DEBUG 5320 — [nio-8282-exec-1] o.s.w.s.handler.SimpleUrlHandlerMapping : Matching patterns for request [/firstTest] are [/**]2017-04-05 12:53:09.397 DEBUG 5320… Read more »
G. VAIBHAV REDDY
Guest
G. VAIBHAV REDDY
21 days 4 hours ago

Angshuman Dey try to change the port number and start again!

Angshuman Dey
Guest
Angshuman Dey
21 days 4 hours ago
Hi Lionel, I can see my tomcat is running. But still getting the White Label error page by default for the url.localhost:8080/hello. Can you help me with that?My eclipse console output is as below2017-04-04 17:06:53.066 INFO 7092 — [ main] com.ad.springboot.app.CourseApiApp : Starting CourseApiApp on angsdey2 with PID 7092 (C:personalSTS-WorkspaceSpring-Bootcourse-apitargetclasses started by ibm in C:personalSTS-WorkspaceSpring-Bootcourse-api)2017-04-04 17:06:53.069 INFO 7092 — [ main] com.ad.springboot.app.CourseApiApp : No active profile set, falling back to default profiles: default2017-04-04 17:06:53.132 INFO 7092 — [ main] ationConfigEmbeddedWebApplicationContext : Refreshing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@1de60b4: startup date [Tue Apr 04 17:06:53 IST 2017]; root of context hierarchy2017-04-04 17:06:55.138 INFO 7092 — [… Read more »
G. VAIBHAV REDDY
Guest
G. VAIBHAV REDDY
23 days 5 hours ago

Thanks Worked like a gem 🙂

Lionel Kamdem
Guest
Lionel Kamdem
1 month 10 days 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
1 month 23 days ago

thanks Rajesh for this tutorial

Yuanzhi Bao
Guest
Yuanzhi Bao
2 months 9 days ago

Thank you! Great videos!

Arpan Sharma
Guest
Arpan Sharma
2 months 13 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
2 months 19 days ago

ty for this video its really helpful 🙂 Great thumbsUP 🙂

Alex Peng
Guest
Alex Peng
2 months 21 days ago

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

wpDiscuz