6- Creating First Project in STS
We are creating our first spring boot application which will have following REST APIs that will handle respective requests for our client to access-
1- A string that returns "Hello World"
When client writes" http://localhost:8080/hello-world "
2- One Student information i.e(firstName and lastName) return in json
When client writes "http://localhost:8080/student"
3- More than One Student information i.e(firstName and lastName) return
When client writes "http://localhost:8080/students"
4- Return the student information we asked for
When client writes "http://localhost:8080/student/{firstName}/{lastName}"
USE THE CONCEPT OF PATH VARIABLE
5- A REST API with concept of Queries in it
-----------------------------------------------
6- Also Explain Spring Boot Dev Tools,Lombok and Embedded Servers
DEPENDENCIES USED- Spring Web
@RestController Annotation
The java class with this annotation is used to access REST API using Browser..
@RestController is combination of @Controller and @ResponseBody
@Controller means controlling Response or to request access services
i.e- All this REST API inside this class should return xml or json or different representatin to the client.
GET - Request to retrieve(find) data
POST- Request to create new data
PUT- Request to update (change) data
DELETE- Request to delete (remove) data
@ResponseBody annotaion uses HTTP converters to convert the return value to HTTP response Body.
Naming Convention is HelloWorldController, StudentController ,etc
Note- I am doing My Project in STS(Spring Tools Suite IDE)
Comments
Post a Comment