Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 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