Spring Boot Tutorial : Part 1 REST

@RestControllerDefines Class that provides REST APIs endpoints methods
@RequestMapping(“/myapp”)Defines endpoint for the overall API Class
Defines Method that provides API endpoint implementation
(@PathVariable int studentId)Defines Variable containing data in endpoint link
public class CrudRestController {

        public List<Student> getStudents() {
                //POJO returned is automatically converted 
                //to JSON by Spring REST using Jackson
                return studentList;

        public Student getStudent(@PathVariable int studentId) {                
                return studentList.get(studentId);


Leave a Reply

Your email address will not be published. Required fields are marked *