Spring 8PM Running Notes
Spring 8PM Running Notes
I am From Hyderbad
10+ Years Ex in JAva Devlopemnt
Currently Aloso I am working for USA Company
Helath Care Domains
Spring Framework.
Spring Framework :
Pre-Req:
Core Java
Adv. Java :
Basic knowledge JDBC
Basic knowledge Servlets
HCL
Infoys
Accenture
COgnizant
BankOFAmerica
int a, int b;
a+b;
int principalAmount;
int intrestAmout;
toatl =
Theory :
Every : thoery :
Make your hands Dirty:
Inheritenc :
A extends B : Thoery
R15 extends Bike : thoery
3. Material/Notes
4. Content of Course
Spring Framework :
Spring
Core
JDBC
JPA/ORM
MVC
Security
2 Months of time
Training :
You will always have internal link to up coming concepts.
internally dependecy
core Java
Adv . java
Spring FW
Spring FW
Key Words
Set of rules
Set rules
Programing Langugae:
Set of rules but not solution of any existing problems
or better approaches fo writing code to complete the our requirement.
Framework : Logics
Solutions on top of Progrming lang.
Servlets:
To create web application,
Web functionalites :
Hello world
service(){
service(){
//reposne : Welome
web.xml
<servlet config>
15 min :
3 lines : 2 to mins
15 mins
Spring Framework:
=================
Core Module :
Core Functionalitie os Spring FW
How Spring FW working
Benefits OF Spring FW
Principle or Designs folowed as part of SPring FW
Very Important :
Core Module :
Spring Release Versions
Advantages oF Spring FW
Spring FW principle
name[0] = Dilip
name[10] = Dilip
name[20] = Dilip
name[99] = Dilip
1 hr : 50 line s
names : Dilip
1. Dependecy Injection :
1. Dependecy Injection :
1. Define/Impllment classes :
2..Don't create Objects : new keyword logic
3. Configure/pass info to SPring FW
4. Spring will create Objects
5. Request Objects from Spring FW
6.
JVM
JVM
what I did?
----------------------------
Inversion : Reversal
- Creating objects
- Configuring oBjects
- Maintaining Lifecycle of Objects
SPring Project :
2003 in MArket
Spring V1 : 2004
2023
Current released or running Spring version is 6...
5 jar files
Dileep
Day-1 https://youtu.be/uDp60mj2KGU
Day-2 https://youtu.be/o5Iu8Hm16iE
Day-3 https://youtu.be/cinbLbNTLxA
Day-4 https://youtu.be/-mRrBinhwRg
Note : full stack java student also can attend the class if the clear all the fee
for full stack java
Spring @ 8.00 PM by Mr. Dileep from 26th June 2023
Fee-3500/- (including GST) without videos
Note : full stack java student also can attend the class if the clear all the fee
for full stack java
Note : If any new student is interested in this batch means pay the 3500-/
Note : After the payment please fill the form if you want regular class link means
👇
http://bit.ly/Spring8DLP
Akhil (Admin)
Mobile: 91541 56192 (Only Whatsapp)
please read clearly what did i mention
1. project Setup
Address
1. XML Configuration
2. JAVa/Annoatation Confgiuration
Spring provided many pre defined xml tags to configure our classes
information
<beans>
</beans>
Address.java
Address class information provising to Spring FW
Choice of Object creation to Spring FW
Spring Bean Class
Student.java
Don't wan to provide to Spring FW, then we should not call it as a Sprign bean.
Clasess are configured with Spring FW are called as Spring Bean classes.
Which are not configured are should not be caled as Spring beans.
<beans>
</bean>
</beans>
Spring IOC container is nothing but Object of Sprig PreDefined Class.
beans.xml :
Address
1. XML Configuratuon
2. JAVa/Annoatation Confgiuration
1. XML Configuratuon:
javac Test.java
java Test
Why <beans>
<bean> we provided our class information.
<bean>
5. getBean(....Bean ID )
classes what we are configured with Spring FW are called ass Spring Bean
classes.
productName = Iphone
price = 100000
productID = 14
// Create Object
ProductDetails product = new ProductDetails();
Dependecy Injection :
Creating OBjects
Spring Injecting those Objects to another Objects called DI,
So that Iam request SFW , could you please inject data of instace varible of
class Product Details.
After creation Object , I want to Inject data for instance variable/properties
of Object
productName = Iphone
price = 100000
productID = 14
When Object create all instace variable are initilized with default values.
1. Setter Injection
2. Constructor Injection
3. Filed Injection
Setter Injection :
=================
1. IOC creating Object for our Bean class with default values of Instance
varibales/properties.
2. Once Object created , After Object Creation , Spring Injecting confgigured value
of properties into Object.
</bean>
product1.setProductName("Iphone");
product1.setPrice(199999);
product1.setProductID("iphone14-2022");
Spring injected value of propertie via setter methods of our bean class.
w.r.to : SFW :
1. Injecting primitives
2. Injecting String data type
3. Collection Objects
List
Set
Map
4. User Defined/Predefined classes Objects / Other class Objects
coke,
choclate,
water bottele
List : <list> child tag of <property> tag
Set : <set> child tag of <property> tag
</map>
Please try to inject : Set of values
set+VariableName
mobileNumber
setMobileNumber
getMobileNumber
<property name="itemsPrices">
<map>
<entry key="Coke" value="60"></entry>
<entry key="choclate" value="100"></entry>
<entry>
<key>Water Bottle</key>
<value>20</value>
</entry>
</map>
</property>
primitive
String
Collection Objects
studentId
studentName
mobileNumber
Address
Address
String city
String state
String country
int pincode
Constructor Injection:
=======================
String clgName;
string sname;
Student(){
clgName = "ABC clg";
sname = "Dilip";
}
Student(String clgName){
this.clgName = clgName;
// Only SI
//ONLY CI
// BOTH
Setter vs
1.Objet create
2. After Obj creation, Calls Setter methods
3.<property>
Constructor Inj:
1. Spring Injecting value while Object creation
Constructor : BY pasing Our all value to Constructor args.
2.<constructor-arg>
Asg :
Set of Value
Map Object
pid;
pname;
price;
productId;
productName;
CI:
primitives
String
Collection LIST,Set, Map
Injecting Another class Objects
Order :
3 properties :
30 properties
String orderId;
double orderValue;
// Class
Product product;
Order(){
}
Core Java:
DatabaseConnection (userName,url,psasword){
}
url
userName
pwd
Bean Wiring :
============
Bean Wiring :
AutoWiring in SP :
=====================
autowire =""
Class A{
B b;
C c;
D d;
E f;
// 7 anotherr classes
B
C
D
E
F
</bean>
IOC Containers:
========
1. BeanFactory : org.springframework.beans.factory
2. ApplicationContext : org.springframework.context
Bean Wiring :
Autowiring :
Feture enables
injecting dependent Objects internally/implicitly by SFW.
Internally Spring Identifying Dependent Objects and injected ot the Other Baan
Objectss.
A need B
Bean B b:
<bena id ="a" class=''''>
</bean>
A{
B b;
1. 4 ways
Inforaming to SPF, please inject Dependecy Object which matches with bean id
and property name of class.
prod != product
</bean>
autowiring : XML
Annoataion :
Dilip
Bean Scopes:
============
Singleton Object:
2nd Object :
It will check IS there any Object avilable with same class
if Object avliable
return Same Object
if not avlible then create object
return newly created Object.
5 types :
Bean Scopes : We can change default Object creation behaviour which is doing by
SFW.
Whenever we are calling/requesting bean object with bean ID from Spring IOC
container, Sprig will return same object again and again.
Spring IOC continer maintains only one object for that specifc bean ID.
2 prototype
For every IOC call getBean(), Spring creating a fresh/new Object and
returing.
3. request:
For Every new incoming HTTP request. SPring IOC conatiner will creates new
instance/ Bean Object.
4. session
scope=session for a bean, Spring will returns new Bean Object for every new
Session Object.
5. application
scope=application, Spring IOC conatiner creates only one bean Object and it
will be attached to ServeletContext in side Spring WEb/MVC module
6. websokcet : WebSocket
@Bean(scope="singleton")
XML
<bean id="student" class="com.tek.teacher.Student">
</bean>
</bean>
@Configuration
public class BeansConfiguration {
@Configuration :
We are going to write a java class and that will called Configuration classes
Inside Configuration classses we are going to write bean creation methods and
those methods will be delared wiht
@Bean annoation.
1. Bena class
2. configuration
3. IOC Container
Spring will not create Object of Bean classes automatically even if we are
configured as part of Configuration classes.
AnnotationConfigApplicationContext context =
new
AnnotationConfigApplicationContext(BeansConfiguration.class);
Assignment:
We can create many beans xml files
2 bena
2 benas
@Bean = <bean>
In side, we are configuring Bean Object
//getBean();
sub1 = 88
s2 =99
s3 =100
(s1+s2+s3)/3
@Component:
1 to 5 classes :
// Manual Confguration
100 classes
@Confgiuration
{
@Bean
...Class1...........
@Bean
.....Class2.........
@Bean
............Class3.....
@Bean
@Bean
@Bean
@Bean
@Bean
Req :
DBConnection{
DBConnection{
url,username,pwd
}
Only one Object : with some values confgured
@Component
Order
@ComponetScan : will be used along with @Configuration class and class level
contect.scan();
1. @Component
2. 10 Configuration classes
50 classes
Default Object s
50 classes
confgiured with value s
Scope of Beans :
================
Default Scope :
@Autowired :
@Qualifier :
when we have more than one bean object for a Bean class, to specify which bean
Object should be injected out of many Bena Objects.
Address:
home,
@Primary
office,
per
Case 1:
Employee:
// No Qulaifier : offcice should be injected
@Autowired
Address address;
Case 2:
Employee:
@Qulaifier("offcie") // Not providing any Qualifier
@Autowired
Address address; res should be injected
if(Qulaifier is avilable)
@Qualifier("home","office","perme")
Student s;
s = newStudet(), new Studnt();
=================================
Animal <Interface>
Impl Classess
Tiger implemntes Animal
etc...
Zoo{
package com.dilip.spring;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
@Component
public class Employee {
// Dependency Obj.
//Field/property injection
@Autowired
private Address address;
public Employee() {
System.out.println("Employee Object Created");
}
//Setter Injection
// Address: home,office:primary
//@Qualifier("offcie")
@Autowired
public void setAddress(Address address) {
System.out.println("This is Seeter method of Addres in Emplyee
class");
this.address = address;
}
@Autowired
public Employee(Address address, Organization org) {
this.org = org;
this.address = address;
}
Asssignment :
Autowiring type :
Types of Autowiring:
====================
autowire : XML :
autowire = no ,
byName;
byType;
constructor;
autowire=byName
autowire = byType;
Address("address") {
}
address
Empl{
Address address;
autowire=constructor
Emp(Address adr){
Annoataions :
@Autowired
==================================================
====================
To perform DB opertions;
1. JDBC MOdule
JDBC :
Register Driver
Create Connection
Execute Query
Close Connection
spring-jdbc.jar
spring-tx.jar
DB specific:
Oracle Db : ojdbc11.jar
Spring JDBC:
//Result rs = ps.execute(query)
ArrayList<Employee> list = new ArrayList();
while() {
list.add(e);
// Row Mapping
// Resultset to ArrayList of Emp Objects
list.add(e);
RowMapper :
impl to mapRow()
JAVA, JSE,JEE
JEE:
java.sql : JDBC : DB interaction : DB operations
JPA is also from JEE: DB interaction : DB operations
1. JPA ?
based on JPA specifcation, we have to write solutions and those solutions we have
to use in our real time projects.
JPA :
interface calc{
add(int a, int b);
}
Third party :
Camel implements Calc{ casio implents calc{
project
DilipCalc{
main(){
add(10,20); // 30
}
}
10+20=?
swiggy:
spring + JPA
****** you are not going to write solutions of JPA specification
ORM :
ORM Functionalities:
Spring JPA module
Maven :
Hibernate
1 jar :
refering other
+ add internal dependecy jar process
NO of Jar file
Maven :
1. Create Project
Internally maven will downalod all jar file into your project
Technical :
apchae :
MAven : we will create a xml file with name : pom.xml
Creation of Project
3. Finsih
Project is Ready.
pom.xml is created.
as part of pom.xml file, we are declaring required jar files of project.
</dependencies>
spring-core-5.3.9.jar:
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.3.9</version>
</dependency>
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc11</artifactId>
<version>23.2.0.0</version>
</dependency>
</dependencies>
Spring Core
Oracle driver
Spring jpa ORM
hibernate
3. Project setup is reday to for Programming
Requirement :
1. Entity classes :
@Entity
@Table
etc...
bY usning entity class we are achving ORM functionality.
Table :
1. Create a class
@Entity
@Table(name="payment_management") // DB table name
Class Payment{
etc,,,
JPA Repository:
===============
SPring JPA :
Spring Provided 2 Pre Defined JPA reposototires:
1. CRUDRepository <Interface>
2. JPARepository <Interface>
Implentation:
Define Reposiotory:
We will create our own repository by extending Spring reposotories.
CrudRepository<T, ID>
Reposiory class:
--------------------
EntityManger:
db.properties
name=dilip
age=30
email=dilipsingh@gmail.com
JPA
In Spring JPA,
TransactionManager Requires
DB details
JPA specification
Hibernate
Toplink
mybatis
ibatis..
TransactionManager :
"hibernate.hbm2ddl.auto", "validate"
@Entity
@Table(name = "flipkart_orders")
public class FlipakartOrder {
@Id
@Column(name = "orderId") // Primary key column
private Long orderID;
@Column(name = "productName")
private String productName;
@Column(name = "TOTALAMOUNT")
private double totalAmount;
update :
create table flipkart_orders(orderId number(222) primary key, productName
vartchar2(256) , totalAmount number(10,9));
Order
1. create tabale in DB
crete entity
2. Create entity
Crete tbale
1. Patient
Information
emailID
Name
Age
Gender
Contact
Create tbale
from the tbale we will entity class
@Entity
@Table
public class StudentDetails{
@Column
int sid
age 36
gnder FEMALE
@Column
private int age;
@Column
private String gender;
getPateintsWithAgeandgender(30, "FEMALE");
JPQL :
Native SQL :
select * from Pateint
1. Create Project
2. SPring JPA Configuration
3. Entity class
4. repository
5. DB operations class
3. Req :
Named PArameters :
syntax :
:nameofparameter
@Param:
Assignments :
insert
update
delete
M - Model
V - View
C - Controller
MVC - ?
Controller :
Controller Layer is responsible for receving Request from View Layer.
ICICI
: Calcuation of Loas intrest
How much u want ? 1000000
12%
60
===============================
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.3.29</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>3.0.1</version>
<scope>provided</scope>
</dependency>
</dependencies>
4. Configuration Class
6. Test Controller :
localhost:8080/spring-mvc-app/hello
http://localhost:8080/spring-mvc-app/login
http://localhost:8080/spring-mvc-app/register
http://localhost:8080/spring-mvc-app/operations
DispatcherServlet
@RequestMapping("/register")
@ResponseBody
public String userRegister() {
return "User Registartion Succeesfull";
}
whenever we are deploying Project, Spring MVC Module internally scans all
@Controller classes
Spring MVC , Scans all URI methods and creates Handler Mappings for very URI
when client triggers Request with /login , thi swill be landed on DispatcherServlet
NOW DS cheks inside Handler mmapings is there any URL avliable with /login
Endpoint Methods:
URI
@RequestMapping("/register") //UserController::userRegister
@ResponseBody
public String userRegister() {
return "User Registartion Succeesfull";
}
//POST
@RequestMapping("/login") //UserController::userLogin
@ResponseBody
public String userLogin() {
return "User Login Succeesfull";
}
//PUT
@RequestMapping("/operations")
@ResponseBody
public String userOperations() {
return "User Operations Succeesfull";
}
Endpoints:
1. Idenitfy which HTTP method should be Defines in side BAckend.
Req :
1. 10 URI :
1. createion user
2. Delet user
3. Update User Data
4. login USer
5. get user data
6. update User Addresss
7. adding New Address
8. Delete address
9. Add Card Detsils
10. GetProduct Details
HTTP:
GET - Used fro Reading/Getting/fetching Data opeartions
POST - USed for Creation/Adding Operations
PUT - Used for Updating Data Operations
DELETE - Used for Delete Operations
@RequestMapping :
If you define @Controller in class level, URI method must should have
@ResponseBody
2. @RestController = @Controller + @ResponseBody
http://localhost:8080/spring-mvc-app/order POST
4.
@GetMapping
@DeleteMapping
http://localhost:8080/spring-mvc-app/order/update
http://localhost:8080/spring-mvc-app/order/load
http://localhost:8080/spring-mvc-app/order/get/all
http://localhost:8080/spring-mvc-app/user/add
http://localhost:8080/spring-mvc-app/user/delete
http://localhost:8080/spring-mvc-app/user/update
JSP pages :
==========
View Resolver:
================
This is component which responsible for resloving view names jsp file names.
1. Assignmnet:
Reigister User
First Name
Last Name
Gender
Age
Qualification
Marks
DOB
XML : Protocol
Http + XML =
REST Services :
=================
https://infinity.icicibank.com/corp/AuthenticationController?
FORMSGROUP_ID__=AuthenticationFG&__START_TRAN_FLAG__=Y&FG_BUTTONS__=LOAD&ACTION.LOA
D=Y&AuthenticationFG.LOGIN_FLAG=1&BANK_ID=ICI&CTA_FLAG=DEPOSIT&ITM=nli_cms_FD_HPDes
ktop_FDIndependenceDay_OpenFDNow_btn&_gl=1*15zgwo8*_ga*MzQyOTMyMzYuMTYzMDQyMjkwMw..
*_ga_SKB78GHTFV*MTYzNzE0MTQ1NC43NC4wLjE2MzcxNDE0NjIuNTI.&_ga=2.57708330.1465037206.
1692371865-1095177735.1679107897
JSON:
=====
Java Script Object Notation
<Student>
<id>2</id>
<name>Laxmi</name>
<marks>333</marks>
</Student>
</Data>
JSON :
key value pairs Data
key:Value
name: Dilip
Ex : Student
{
"id":1,
"name":"Dilip",
"marks": 333.99,
"isSelected" : false
}
{
"id":1,
"name":"Dilip",
"marks": 333.99,
"isSelected" : false
},
{
"id":1,
"name":"Dilip",
"marks": 333.99,
"isSelected" : false
},
{
"id":1,
"name":"Dilip",
"marks": 333.99,
"isSelected" : false
}
]
}
====================
{
"name" : "Dilip",
"email" : "dilip@gmail.com",
"mobile" : "+91 73777373",
"password" : "Dilip123"
}
To support JSON Data Format in Spring MVC , we should add Some Dependecies
Devloper :
adding jar files which are resposible for Conversion from JAVA to JSON
and vice versa.
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.15.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.15.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.15.2</version>
</dependency>
Post Man:
Add requet
Select HTTP method
enter URL
Select BOdy
raw
JSON
id:1234
name:dilip
avgMarks:78.77
{
"name": "Dilip Singh",
"email": "Dilip@gmail.com",
"mobile": "7237237",
"password": "Dilip123"
}
[
{
"name": "Dilip Singh",
"email": "Dilip@gmail.com",
"mobile": "7237237",
"password": "Dilip123"
},
{
"name": "Suresh Singh",
"email": "Suresh@gmail.com",
"mobile": "333",
"password": "Suresh123"
},
{
"name": "Naresh Singh",
"email": "Naresh@gmail.com",
"mobile": "34343",
"password": "Naresh123"
}
]
Request:
[
{
"name": "Dilip Singh",
"email": "Dilip@gmail.com",
"mobile": "7237237",
"password": "Dilip123"
},
{
"name": "Suresh Singh",
"email": "Suresh@gmail.com",
"mobile": "333",
"password": "Suresh123"
},
{
"name": "Naresh Singh",
"email": "Naresh@gmail.com",
"mobile": "34343",
"password": "Naresh123"
}
]
=========================
Repository Layer:
====================
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>5.6.9.Final</version>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>2.1.0.RELEASE</version>
</dependency>
swiggy_users
"name": "Dilip",
"email": "aaa@gmail.com",
"mobile": "+91 73777373",
"password": "Dilip123"
4 columns :
name : String
email : String
mobile : String
password : String
Path Variables:
===============
10 products : order1234567
Get Order Details based on OrderId:
order1234567 :
/user/fetch/{emailID}
/user/fetch/dilip@gmail.com
http://localhost:8080/swiggy/user/get/{emailId}
http://localhost:8080/swiggy/user/get/Dilip@gmail.com
Req :
swiggy_order
orderID
orderstatus
amount
emailId
city
localhost:8000/swiggy/user/get?city=Hyderabad&gender=male
gender
male , female
city
Bang.pune
Contrroller :
Logic
/user/get/city/{city}/age/{age}
1000 Users
city: Hyd
age=25
https://www.flipkart.com/mobile-phones-store?fm=neo
%2Fmerchandising&iid=M_033281d6-a020-4759-b9b5-
58a84c3f26ea_1_372UD5BXDFYS_MC.ZRQ4DKH28K8J&otracker=hp_rich_navigation_2_1.navigat
ionCard.RICH_NAVIGATION_Mobiles_ZRQ4DKH28K8J&otracker1=hp_rich_navigation_PINNED_ne
o%2Fmerchandising_NA_NAV_EXPANDABLE_navigationCard_cc_2_L0_view-
all&cid=ZRQ4DKH28K8J
https://www.flipkart.com/television-store?otracker=nmenu_sub_TVs%20and
%20Appliances_0_Televisions&otracker=nmenu_sub_TVs%20%26%20Appliances_0_Television
flipkart/products/tv
https://www.flipkart.com/search?sid=czl&otracker=CLP_Filters&p%5B
%5D=facets.brand%255B%255D%3DMi
https://www.flipkart.com/search?sid=czl&otracker=CLP_Filters&p%5B
%5D=facets.brand%255B%255D%3DMi&p%5B%5D=facets.screen_size%255B%255D%3D48%2B-
%2B55%2Binch
https://www.flipkart.com/search?sid=czl&otracker=CLP_Filters&p%5B
%5D=facets.screen_size%255B%255D%3D48%2B-%2B55%2Binch&p%5B%5D=facets.brand%255B
%255D%3DMi&p%5B%5D=facets.operating_system%255B%255D%3DAndroid
HTTP status codes are 3 digit numbers, prodcued by web server as part of
response.
These codes represents outcome of Request that menas status of coomunication b/w
cleint server.
Status code are part of HTTP protocol.
4XX: Cleint Sode Errors : Exposing Cleint Side Data problems or errors.
5XX: Server Error: Exposing Server Side problems or errors while executing Cleint
Requests.
100 Continue :
102 : Proccessing
201 Created:
204 No Content :
wilson@gmail.com
ResponseEntity:
===============
Response+Entity
XML
HTTP Headers :
================
Headers will be used to exachange information between and cleint and server along
with Request and Response Data.
what information:
Content Type of Request and Resoonse
Cookies
Authentication
and
Authorization
RestServices/API Integration/Communication
==========================-====
Response :
{
"paymentID": "payment123456",
"payamentStaus": "Suucess",
"paymentDate": "2023-09-01"
}
RestTemplate :
XML Response/Request:
Security Module:
<UserAccountData>
<gmailId>dilip@gmail.com</gmailId>
<fullName>DilipSIngh</fullName>
<defaultMemoryInGB>15</defaultMemoryInGB>
</UserAccountData>
Response :
============
accept:application/json
accept:application/xml
I want Response data in XML fromat
Spring Security:
================
Security :
Authorization:
What you are?
NareshIt :
Studentds
limitations
Registering
Allowed access only Training
Trainer
limittations
I can access all Stduents of my Training
I am passing some rules to Students
Admin
limitation
Pass Rules to Students and Trainers
Authrization:
Students imformation as prt of your training
Gmail :
dilip@gmail.com
dilip123
satteless vs Statefull :
JWT :
How to genarate tokens
validate Tokens
Stateless vs Statefull:
---------------------------
JWT is a open industry standard to share information b/w two resources like
Header
: Singing Algorithm being used to genarte a token
Payload :
User Name
JWT jar :
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-api</artifactId>
<version>0.11.2</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-impl</artifactId>
<version>0.11.2</version>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt-jackson</artifactId>
<version>0.11.2</version>
</dependency>
1. Creation of Token
2. Valiadation of Token
is It Correct UserName or not?
is It Expired or Not