0% found this document useful (0 votes)
8 views

Spring Boot-Notes

Uploaded by

bakajo6678
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Spring Boot-Notes

Uploaded by

bakajo6678
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

-mote taur par spring boot=spring +autoconfiguration.

- these are the additional things we get


1. Autoconfiguration,Embedded server,external configuration
- spring boot jo hai spring ke upar bana hua hai toh additionally kam hame spring
par hi karna padega, bad to xml and baki cheeje seek hi lenge time ke sath

- Lombok= Java annotation library which helps to reduce boilerplate code.


- What is the CommandLineRunner interface example dekh le?usme ek run method bhi
hota hai so look it as well.
- bean banane ke bad ab ham jo pahle karte the na new Obj() khud se create wo ab
krne ki jaroorat nhi ab se mai handle karunga wo object ko and jaha bhi jaroorat
hogi mai supply karunga.

-application.properties file me configuration kaise set hota hai prodDBBean and


DecDBBean

-project.mode=development
after setting this up in application.properties file now set
@ConditionalOnProperty(name="project.mode", havingValue="development")
|
Property jo define ki hai uske upar kuch conditions hai

- kisi bhi project ka ham envrment variable define kar sakte hai (similar to env
variable we have in os) which will have precedence over the configuration set in
application.properties

-convention over configuration=means hamne ek configuaration define kar di hai now


you don't need to use dilffernt configuration for the same thing.

- Spring MVC
Spring MVC is a part of the Spring Framework that implements the MVC design
pattern. It provides a flexible way to build web applications and REST APIs by
following the MVC architecture. Here’s a basic overview:

Model: In Spring MVC, the model can be represented by POJOs (Plain Old Java
Objects) or data entities that are used to store and manipulate data. These models
are usually populated from the database and passed to the view.

View: Spring MVC supports various view technologies like JSP (JavaServer Pages),
Thymeleaf, and FreeMarker. The view is responsible for rendering the data from the
model into a format that can be presented to the user.

Controller: The controller in Spring MVC is a Java class annotated with @Controller
or @RestController. It handles incoming HTTP requests, processes them (often
involving the model), and returns the appropriate view or data.

*****************************--REST APIs also called as RESTful APIs.


- REST is a set of architectural constraints, not a protocol or a standard.API
developers can implement REST in variety of ways.
- REST API follows the constraint of REST architecture style and allows for
interaction with RESTful webserivces.

-REST APIs work over HTTP


Delivers information using any one of the following formats -
JSON (Most popular) , Text , HTML , XML , Javascript and more
-@RequestBody

Purpose: This annotation binds the HTTP request body to the User parameter. It
tells Spring to convert the incoming JSON data (in the request body) into a User
object.
Usage: When a client sends a POST request with a JSON payload, @RequestBody will
deserialize this JSON into a User object.

You might also like