• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

I have STS Version: 3.8.1.RELEASE but I cannot use @RestController

 
Ranch Hand
Posts: 502
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I cannot import org.springframework.web.bind.annotation.RestController.
 
Bartender
Posts: 3648
16
Android Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The @RestController is part of the Spring MVC library. I believe STS comes with core Spring.
 
Alejandro Barrero
Ranch Hand
Posts: 502
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well all the examples that I have seen use org.springframework.web.bind.annotation.RestController; it works for them; but I cannot import it. I cam import  org.springframework.web.bind.annotation.RequestMapping and org.springframework.web.bind.annotation.RequestMethod; I imagine they should be in the same jar file. For some reason they are not in org.springframework.web.bind.annotation in spring-web-3.1.1.RELEASE.jar in Maven Dependencies; I am more confused.

Looking at other examples, I am beginning to see cases where objects are returned using @Controller; maybe that's the modern way; I am going to try it, but who knows. Of course at the end I can use ResponseEntity.
 
reply
    Bookmark Topic Watch Topic
  • New Topic