SlideShare a Scribd company logo
Santosh Kumar Kar,
Lead Software Engineer, EPAM
santosh_kar@epam.com
Before we start
A task for you – time 15 minutes
Develop a web application which reads Employee information from
MySQL DB and print on the screen. You need to use Spring and
Hibenate(JPA). It should run in any web container.
List out the challenges you have faced while setting up the env.
1) Download and set up a server (e.g. Tomcat)
2) Download and install a DB
3) Download required Spring jars
4) Download Hibernate jar compatible with the Spring version
5) Download jar for MySQL driver
6) Setting up web.xml to use spring MVC
7) Anything I left ???
Before we start
Why Spring Boot
• Provides a radically faster and widely accessible ‘getting started’
experience for all Spring development
• No clumsy XML Configuration by developers
• Provide opinionated ‘starter’ POMs to simplify your Maven
configuration
• Uses project management tool such as MAVEN or GRADLE
• Helps fast development and production ready code
• Embed Tomcat, Jetty or Undertow directly (no need to deploy WAR
files)
• In memory DB
Documentation
http://docs.spring.io/spring-boot/docs/current/reference/html/index.html
System Requirement Spring Boot 1.4.2.RELEASE
• Apache Maven
• Java 7 +
http://start.spring.io – a good starting point
Folder Structure to be followed
Understanding pom.xml
Build runnable jar
First Java Program for spring boot
Running the application
> mvn spring-boot:run
Devtools
• Automatic Restart
• LiveReload
• Remote Debug Tunneling
• Remote Update and Restart
Details at:
http://docs.spring.io/spring-boot/docs/current/reference/html/using-boot-devtools.html
Spring Tool Suite (sts)
Download https://spring.io/tools/sts/all
Spring Web & MVC
application.properties
pom.xml
Without application.properties
Runnable war
1) In Main java file:
1.1 extend : org.springframework.boot.web.support.SpringBootServletInitializer
1.2 override the method:
@Override
protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
return application.sources(MyApplication.class);
}
1.3 No need of main() method.
2) In pom.xml
1.1 Change the packing to war as:
<packaging>war</packaging>
3) Use command: mvn clean package
4) In target, rename the war<context root> as you want, deploy in tomcat and access with <context root>/<request mapping>
MySQL & jdbc
pom.xml
spring.datasource.jndi-name=java:jboss/datasources/customers - For JNDI Datasource
MySQL & jdbc
JPA in Spring Boot
JPA in Spring Boot
JPA in Spring Boot
JPA in Spring Boot
Things to learn:
Only interface is enough which inherits to CrudRepository. The implementation will be provided by spring.
To know the other inherited methods, please go through the CrudRepository API.
JPA in Spring Boot
Code
https://github.com/santoshkar/SpringBoot.git
The code can be downloaded from:
Send to skkar.2k2@gmail.com
Questions ???

More Related Content

Similar to dokumen.tips_introduction-to-spring-boot-58bb649a21ce5.pptx

Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»
Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»
Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»DataArt
 
Spring Boot
Spring BootSpring Boot
Spring Boot
Jaran Flaath
 
InitiateAEv2.pdf
InitiateAEv2.pdfInitiateAEv2.pdf
Spring competitive tests
Spring competitive testsSpring competitive tests
Spring competitive tests
SkillPracticalEdTech
 
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot Introduction
Jeevesh Pandey
 
Spring Live Sample Chapter
Spring Live Sample ChapterSpring Live Sample Chapter
Spring Live Sample ChapterSyed Shahul
 
Bootify your spring application
Bootify your spring applicationBootify your spring application
Bootify your spring application
Jimmy Lu
 
Spring Boot & Actuators
Spring Boot & ActuatorsSpring Boot & Actuators
Spring Boot & Actuators
VMware Tanzu
 
Maven
MavenMaven
Maven
Shraddha
 
Xke spring boot
Xke spring bootXke spring boot
Xke spring boot
sourabh aggarwal
 
Spring boot competitive tests
Spring boot competitive testsSpring boot competitive tests
Spring boot competitive tests
SkillPracticalEdTech
 
Spring boot competitive tests
Spring boot competitive testsSpring boot competitive tests
Spring boot competitive tests
SkillPracticalEdTech
 
Maven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable ResultsMaven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable Results
Steve Keener
 
Spring hibernate tutorial
Spring hibernate tutorialSpring hibernate tutorial
Spring hibernate tutorial
Rohit Jagtap
 
Spring boot jpa
Spring boot jpaSpring boot jpa
Spring boot jpa
Hamid Ghorbani
 
Spring Boot Whirlwind Tour
Spring Boot Whirlwind TourSpring Boot Whirlwind Tour
Spring Boot Whirlwind Tour
VMware Tanzu
 
Spring boot
Spring bootSpring boot
Spring boot
sdeeg
 
Introduction to Maven
Introduction to MavenIntroduction to Maven
Introduction to Maven
Onkar Deshpande
 
Using protractor to build automated ui tests
Using protractor to build automated ui testsUsing protractor to build automated ui tests
Using protractor to build automated ui tests
🌱 Dale Spoonemore
 
Advance java prasentation
Advance java prasentationAdvance java prasentation
Advance java prasentation
dhananajay95
 

Similar to dokumen.tips_introduction-to-spring-boot-58bb649a21ce5.pptx (20)

Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»
Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»
Станислав Сидоренко «DeviceHive Java Server – миграция на Spring Boot»
 
Spring Boot
Spring BootSpring Boot
Spring Boot
 
InitiateAEv2.pdf
InitiateAEv2.pdfInitiateAEv2.pdf
InitiateAEv2.pdf
 
Spring competitive tests
Spring competitive testsSpring competitive tests
Spring competitive tests
 
Spring boot Introduction
Spring boot IntroductionSpring boot Introduction
Spring boot Introduction
 
Spring Live Sample Chapter
Spring Live Sample ChapterSpring Live Sample Chapter
Spring Live Sample Chapter
 
Bootify your spring application
Bootify your spring applicationBootify your spring application
Bootify your spring application
 
Spring Boot & Actuators
Spring Boot & ActuatorsSpring Boot & Actuators
Spring Boot & Actuators
 
Maven
MavenMaven
Maven
 
Xke spring boot
Xke spring bootXke spring boot
Xke spring boot
 
Spring boot competitive tests
Spring boot competitive testsSpring boot competitive tests
Spring boot competitive tests
 
Spring boot competitive tests
Spring boot competitive testsSpring boot competitive tests
Spring boot competitive tests
 
Maven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable ResultsMaven: Managing Software Projects for Repeatable Results
Maven: Managing Software Projects for Repeatable Results
 
Spring hibernate tutorial
Spring hibernate tutorialSpring hibernate tutorial
Spring hibernate tutorial
 
Spring boot jpa
Spring boot jpaSpring boot jpa
Spring boot jpa
 
Spring Boot Whirlwind Tour
Spring Boot Whirlwind TourSpring Boot Whirlwind Tour
Spring Boot Whirlwind Tour
 
Spring boot
Spring bootSpring boot
Spring boot
 
Introduction to Maven
Introduction to MavenIntroduction to Maven
Introduction to Maven
 
Using protractor to build automated ui tests
Using protractor to build automated ui testsUsing protractor to build automated ui tests
Using protractor to build automated ui tests
 
Advance java prasentation
Advance java prasentationAdvance java prasentation
Advance java prasentation
 

Recently uploaded

The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
Thiyagu K
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
TechSoup
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
camakaiclarkmusic
 

Recently uploaded (20)

The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Unit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdfUnit 8 - Information and Communication Technology (Paper I).pdf
Unit 8 - Information and Communication Technology (Paper I).pdf
 
Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
CACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdfCACJapan - GROUP Presentation 1- Wk 4.pdf
CACJapan - GROUP Presentation 1- Wk 4.pdf
 

dokumen.tips_introduction-to-spring-boot-58bb649a21ce5.pptx