0% found this document useful (1 vote)
171 views

SpringBoot Notes

The document discusses Spring security, annotations, and concepts. It describes using the spring-boot-starter-security dependency to enable authentication based on knowledge, possession, or both. It lists common Spring annotations like @Component, @Controller, @Service, and @Repository. It also explains concepts like dependency injection, inversion of control (IOC), aspect oriented programming (AOP), Spring Actuator, and the Spring bean lifecycle.

Uploaded by

raj joshi
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
171 views

SpringBoot Notes

The document discusses Spring security, annotations, and concepts. It describes using the spring-boot-starter-security dependency to enable authentication based on knowledge, possession, or both. It lists common Spring annotations like @Component, @Controller, @Service, and @Repository. It also explains concepts like dependency injection, inversion of control (IOC), aspect oriented programming (AOP), Spring Actuator, and the Spring bean lifecycle.

Uploaded by

raj joshi
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

Spring Sercuirty

{spring-boot-started-security} use this dependancy


1)knowledge based Authantacation :-ID,Password
2)Possession based Authantacation:-Access Token
3)knowledge + Possession Authantacation:-Multifactor auth

SpringBoot Annotations
1)@SpringBootApplication - enables Spring Boot autoconfiguration and component
scanning.
2)@Bean - indicates that a method produces a bean to be managed by Spring.
3)@Service - indicates that an annotated class is a service class.
4)@Repository - indicates that an annotated class is a repository, which is an
abstraction of data access and storage.
5)@Configuration - indicates that a class is a configuration class that may contain
bean definitions.
6)@Controller - marks the class as web controller, capable of handling the
requests.
7)@RequestMapping - maps HTTP request with a path to a controller method.
8)@Autowired - marks a constructor, field, or setter method to be autowired by
Spring dependency injection.
9)@Component- is a generic stereotype for a Spring managed component. It turns the
class into a Spring bean at the auto-scan time. Classes decorated with this
annotation are considered as candidates for auto-detection when using annotation-
based configuration and classpath scanning.
10)@Repository, @Service, and @Controller are specializations of @Component for
more specific use cases.
11)@EnableAutoConfiguration (exclude ={classname})
12)@Controller- Map of the model object to view or template and make it
humanreadble
13)@Restcontroller- simply return the object and object data directly weitten in
http response as JSON or XML (@Controller+ @RsponseBody)
14)@ControllerAdvice- use for globale exception handling
15)@ExceptionHandler -use for exception handling massges for custome exceptions
16)@NotBlank - bean field is not empty. this is use for server side validation
using javax validation dependancy
Tip:-
There are also Hibernate @Entity, @Table, @Id, and @GeneratedValue annotations in
the example.
(*)Dependencies Injection:- it is smiler type of design pattern
loose cupling provide object without
directly
(*)IOC:- (Inversion of Control) Represent the inversion of responsibility of Object
creation, intitialization and destruction from application of Spring container

(*)AOP:- (Aspact Oriented Programming) AOP is programming paradigm that aims to


increase modularity by allowing the sepration of cross-cutting concerns.
Process of applying services or external services as transaction
managenent or logging to our application without modifiyng the code.
the service also called cross-cutting concern.
AOP compelements object oriented programming by another way of thinking
about program stucture.
(*)Spring Actuator:- Provides special feature to monitor and manage application
when you push it producation.
(*)Spring Bean Life Cycle :- 1) Container Started
2) Bean Instanited
3) Dependencies Injected
4) Custom init method
5) Custom utility method
6) Custom destroy method

You might also like