Skip to main content

Posts

Showing posts with the label SPRING BOOT

Spring Boot Annotations

Spring Boot Annotations :   As explained in my previous post Spring uses conditional interface to do auto configuration , below are the most common annotation used in Spring boot application. We will try to understand these annotations by developing a spring boot application from scratch. We are going to create a restful webservice using spring Boot. Generally there can be at least six or more packages as below : Configuration Controllers Services DAO Entities Utilities 1. Configuration ( To Enable Web security , Database Configuration , MQ Configuration ) To do so we will create our custom configuration class and annotate with @Configuration and for properties from configuration file @ ConfigurationProperties("nameOfPropertiesIdentfier") Inside that we will set all the required properties inside the bean of Respective configuration for example in case of Database , DataSource , JdbcTemplate etc. First we need to put the below dependency then we need create a configurat...

Spring Boot Overview

What is Spring ?  Spring Framework is an application framework and inversion of control container (IOC).  What is inversion of control ? By name only you can predict that it inverses the control , but question is control of what ? And the answer to this is creation of Beans. To understand this lets understand Association which is of 2 types 1)Aggregation and 2) Composition In Aggregation we will have instances of one class to other class and in Composition also its same, only difference is that in composition it will be more dependent to each other while in Aggregation both classes will be independent .  But in both the scenarios they need instances of each other. Let's consider below example before Spring how we used to associate a class into another class. class Student{ String name ; String id ; Address Address = new Address() ; int mobile ; } class Address{ int houseNumber ; String roadName ; String landMark ; String district ;...

SECURITY IN SPRING BOOT : Authentication and Authorisation in Spring boot Application

SECURITY IN SPRING BOOT : Authentication and Authorisation in Spring boot Application In any application security is the most important aspect without this no application can be considered as standard application as it will have full exposure to hackers. Now to secure our application there are 2 important concept  Authentication and Authorisation  which we should know .     Authentication stands for authentication of the client from your request is coming and to do so we will receive unique username and password for that to validate the authenticity of client. If it passes through our authentication process and identified as valid client then we will proceed and allow to access our URI and resources.   Authorisation comes after authentication in which we will allow to access our resources based on type of client if client is an Admin then he will have full access , if client is Premium user then he will have access to all premium resources if client is...