All Projects → celalaygar → Spring-Boot-2

celalaygar / Spring-Boot-2

Licence: other
Spring Boot 2.x examples

Programming Languages

java
68154 projects - #9 most used programming language
javascript
184084 projects - #8 most used programming language
HTML
75241 projects
CSS
56736 projects

Projects that are alternatives of or similar to Spring-Boot-2

BusinessInfrastructurePlatformGroupVersion
A java web project based on Spring Boot using MySQL, Spring MVC, Hibernate, Spring Data JPA, Query DSL, Lombok, Logback, etc.
Stars: ✭ 90 (+172.73%)
Mutual labels:  thymeleaf, spring-data, spring-security, hibernate, springboot, spring-mvc, spring-data-jpa
spring-boot-shop-sample
My first web application using Spring Boot framework.
Stars: ✭ 66 (+100%)
Mutual labels:  thymeleaf, spring-security, hibernate, spring-mvc, spring-data-jpa, h2
Spring Boot Enterprise Application Development
Spring Boot Enterprise Application Development.《Spring Boot 企业级应用开发实战》
Stars: ✭ 261 (+690.91%)
Mutual labels:  thymeleaf, spring-security, hibernate, spring-mvc, spring-data-jpa, bootstrap-4
Angularjs Springmvc Sample Boot
A RESTful sample using Spring Boot, Spring MVC, Spring Data and Angular/Bootstrap.
Stars: ✭ 309 (+836.36%)
Mutual labels:  spring-data, jpa, hibernate, spring-mvc, spring-data-jpa
Spring Examples
SpringBoot Examples
Stars: ✭ 67 (+103.03%)
Mutual labels:  rabbitmq, spring-data, spring-security, springboot, spring-data-jpa
Spring Boot Blog
Simple blog web app made using Spring Boot + Thymeleaf
Stars: ✭ 121 (+266.67%)
Mutual labels:  thymeleaf, spring-security, springboot, spring-mvc, spring-data-jpa
vogon-java
Vogon - A simple personal finance tracker using Spring Boot and AngularJS
Stars: ✭ 16 (-51.52%)
Mutual labels:  jpa, hibernate, spring-mvc, spring-data-jpa, h2
spring-boot-java-swing-reservations
The project aims to present how to connect Spring Boot 2 and Java Swing GUI widget toolkit. All application dependencies are provided by Docker Compose. There are also static code analysis tools like FindBugs and Checkstyle.
Stars: ✭ 86 (+160.61%)
Mutual labels:  spring-data, jpa, hibernate, springboot, spring-boot-2
Spring5Certification
Spring Certification: This repository contains my examples and some best references to prepare the Spring 5 certification
Stars: ✭ 30 (-9.09%)
Mutual labels:  spring-data, spring-security, springboot, spring-mvc, spring-data-jpa
Spring Boot Leaning
Spring Boot 2.X 最全课程代码
Stars: ✭ 2,008 (+5984.85%)
Mutual labels:  thymeleaf, jpa, springboot, springboot2
Spring Boot Examples
个人学习 SpringBoot2.x 写的一些示例程序,目前正在持续更新中.....
Stars: ✭ 159 (+381.82%)
Mutual labels:  thymeleaf, jsp, rabbitmq, springboot
Library-Spring
The library web application where you can borrow books. It's Spring MVC and Hibernate project.
Stars: ✭ 73 (+121.21%)
Mutual labels:  spring-security, hibernate, spring-mvc, bootstrap-4
TASK-Management-System
Spring Boot and Angular 7 web application for task management .
Stars: ✭ 34 (+3.03%)
Mutual labels:  spring-data, spring-security, hibernate, spring-data-jpa
Hibernate Springboot
Collection of best practices for Java persistence performance in Spring Boot applications
Stars: ✭ 589 (+1684.85%)
Mutual labels:  spring-data, jpa, hibernate, springboot
Registration Login Spring Xml Maven Jsp Mysql
Registration and Login Example with Spring MVC, Spring Security, Spring Data JPA, XML Configuration, Maven, JSP, and MySQL.
Stars: ✭ 134 (+306.06%)
Mutual labels:  jsp, spring-security, spring-mvc, spring-data-jpa
Spring Petclinic Rest
REST version of the Spring Petclinic sample application
Stars: ✭ 257 (+678.79%)
Mutual labels:  spring-data, hibernate, spring-mvc, spring-data-jpa
Spring Boot Examples
about learning Spring Boot via examples. Spring Boot 教程、技术栈示例代码,快速简单上手教程。
Stars: ✭ 26,812 (+81148.48%)
Mutual labels:  thymeleaf, rabbitmq, springboot, spring-data-jpa
Favorites Web
云收藏 Spring Boot 2.X 开源项目
Stars: ✭ 4,485 (+13490.91%)
Mutual labels:  thymeleaf, jpa, springboot, spring-data-jpa
Spring Mvc Thymeleaf Crud
Spring MVC CRUD Application with Thymeleaf, HTML5, CSS3 and Bootstrap
Stars: ✭ 14 (-57.58%)
Mutual labels:  thymeleaf, spring-data, spring-mvc, spring-data-jpa
Library
Online Library Management. User can search, check in, checkout book. System adds fines automatically if the book is not checked in by due date
Stars: ✭ 27 (-18.18%)
Mutual labels:  spring-data, hibernate, spring-mvc, spring-data-jpa

Spring-Boot-2

  • How to change port number? if you wanna change port number, write (server.port=3132) command on application.properties in src/main/resources/application.properties. you can change port number in applicaton.properties.
server.port=8182
  • You had bettet to look at this applicaton.properties pls. Database's table can be generated automatically, İf you write spring.jpa.hibernate.ddl-auto=create on application.properties.
  • your database's table can create regularly when you wrote spring.jpa.hibernate.ddl-auto=create on application.properties
for Referans how to learn spring technology.
- https://docs.spring.io/spring-data/jpa/docs/current/reference/html/
- https://www.logicbig.com/                           - https://howtodoinjava.com/
- https://o7planning.org/                             - https://www.concretepage.com/spring-boot/
- https://memorynotfound.com/                         - https://www.dineshonjava.com/

1 - spring-boot-HelloWorld

how to run project. Look at application.properties where Port number is there.

Links: 
    http://localhost:3092/    http://localhost:3092/welcome

2 - spring-boot-view-JSP-File-1

How to use and view jsp file on spring boot

Links: 
http://localhost:8182/    http://localhost:8182/personels

3 - spring-boot-view-Error-Page

How to use and view Error page on spring boot
First, You have to add to src/main/resources/public/error/(ErrorPage.html) such as 404.html or 403.html if you wanna see error page.
if you write one of bottom links, you can't see error page as error.html

http://localhost:8182/    http://localhost:8182/personels

if you write one of bottom links, you can see error page as error.html

http://localhost:8182/deneme                           http://localhost:8182/asd        
http://localhost:8182/asdqwe/121243dqwe?c=asldkwqe     http://localhost:8182/deneme.jsp

4 - springboot-(REST_API_QUERY)

(Static)

how to use RequestMethod.POST, RequestMethod.PUT, RequestMethod.DELETE and RequestMethod.GET
you can experiment with JUNİT on PersonelClinicRestControllerTest.java (src/test/java/com/javaegitimleri/app/web/)

You can try runnuing anymethods with run as -> Junit Test in src/test/java/com/javaegitimleri/app/web/PersonelClinicRestControllerTest.java. 
Then you can look at changing data on localhost:8182/rest/personels

5 - springboot-with-h2-database (REST_API_QUERY) (jdbc with h2 database)

how to create schema, table and add data with jdbc in table. you can look src/main/resources/ data.sql & schema.sql.
how to use h2 database with jdbc.

Also You can try runnuing createPersonelTest, deletePersonelTest methods with run as -> Junit Test 
in src/test/java/com/javaegitimleri/app/web/PersonelClinicRestControllerTest.java.

6 - springboot-jpa-with-h2-database (REST_API_QUERY)

how to use jpa with h2 database
how to use @Transactional, @Id, @GeneratedValue, @Entity, @Table @Column

7 - springboot-simple-security-example

how to use login and logout procedure
how to use specific login page
how to use remember me for security login
First you have to add spring-boot-starter-security dependency file in pom.xml.
look at application.properties file in src/main/resources/...

#you can change username and password. then you can try login proccessing
spring.security.user.name=celal
spring.security.user.password=123456

8 - SpringJPA-PostgreSQL-Example

first step Open pdAdmin 4, use SQL Editor and make a query to create customer table in database called Personels Also you can create any database called diffrent name.

CREATE TABLE customer(
    id BIGINT PRIMARY KEY     NOT NULL,
    firstname VARCHAR(20),
    lastname VARCHAR(20)
);

second step

First you need to write localhost:8182/save
Then you can try writing bottom any link
localhost:8182/findall
localhost:8182/findbyid?id=3  
localhost:8182/findbylastname?lastname=Terim

9 - springboot-security-with-h2-example

How to use login process
Anybody has ROLE_EDITOR or ROLE_ADMIN can enter links called /rest/** and /actuator/** for AUTHORIZATION.Anybody only has ROL_USER can't enter links called /rest/** and /actuator/**

  • links -> localhost:8182/rest/personels, localhost:8182/rest/personel/3, localhost:8182/rest/personel?fn=Celal
  • links -> localhost:8182/actuator/health
INSERT INTO USERS VALUES('user1','{noop}12345',TRUE);
INSERT INTO USERS VALUES('user2','{noop}secrett',TRUE);
INSERT INTO USERS VALUES('celal','{noop}secret',TRUE);

you can write data below first-three sql queries instead of above sql queris in src/main/resources/data.sql

INSERT INTO USERS VALUES('user1','{bcrypt}$2a$10$FMQOTEUiRN1L2MV2gfYas.MEDnLcEffuenRme5WdFgkwcuWA2jyhG',TRUE);
INSERT INTO USERS VALUES('user2','{bcrypt}$2a$10$.qPu/z1bV0Lw5uSpv6YMKeiCUI4rsxfNY/HJJBgw9E7CYUULMW3CS',TRUE);
INSERT INTO USERS VALUES('celal','{bcrypt}$2a$10$m9RM8vLgWvu/8Ig21HURG.IHIeFEie8CsKaGV1FeQ88bi27Xz4wJS',TRUE);

username and password will be same again when you changed first-three lines in src/main/resources/data.sql.
for encrypted data you can look at PasswordEncoderTest.java class in src/test/com/javaegitimleri/ap/test for example (encrypted data)

  • 12345 -> {bcrypt}$2a$10$FMQOTEUiRN1L2MV2gfYas.MEDnLcEffuenRme5WdFgkwcuWA2jyhG
  • secrett -> {bcrypt}$2a$10$.qPu/z1bV0Lw5uSpv6YMKeiCUI4rsxfNY/HJJBgw9E7CYUULMW3CS
  • secret -> {bcrypt}$2a$10$m9RM8vLgWvu/8Ig21HURG.IHIeFEie8CsKaGV1FeQ88bi27Xz4wJS

10 - Spring-Boot-10-JPA-PostgreSQL-CRUD-RESTful Services-And-Jsp

how to use postgresql with jpa for CRUD for RESTful and jsp file. create, read, update, delete
Open pdAdmin 4, use SQL Editor and make a query to create customer table in database called Personels.Also you can create any database called diffrent name.

CREATE TABLE customer(
    id BIGINT PRIMARY KEY     NOT NULL,
    firstname VARCHAR(20),
    lastname VARCHAR(20)
);

you can try below sample links.

localhost:8182/                 localhost:8182/customers          localhost:8182/customer/1
localhost:8182/rest/customers   localhost:8182/rest/customer/1 

11 - Spring-Boot-11-SpringData-1-JPA-PostgreSQL

how to use @OneToOne, @JoinColumn, @JsonIgnore for spring boot and data in multiple table.
first one : create bottom table on any database called Users in pgAdmin 4.
if you change database's name. you can change.

CREATE TABLE customer(
    id BIGINT PRIMARY KEY     NOT NULL,
    name VARCHAR(255),
    email VARCHAR(255)
);

CREATE TABLE details(
    id BIGINT PRIMARY KEY  NOT NULL,
    city VARCHAR(255),
    country VARCHAR(255),
    phone_number VARCHAR(255),
    customeid BIGINT,
    FOREIGN KEY (customerid) REFERENCES customer (id)
);

second one : Write localhost:8182/insert to insert data on database. then write other link

localhost:8182/details  localhost:8182/customers   localhost:8182/customers   localhost:8182/customer/{id}
  localhost:8182/customerjson/{id}

12 - Spring-Boot-12-SpringData-2-JPA-PostgreSQL

how to use @ManyToOne for spring boot and data in multiple table.
how to use specific sql query with @Query
first one : create bottom table on any database called Users in pgAdmin 4.
if you change database's name. you can change.

CREATE TABLE car(
    id BIGINT PRIMARY KEY     NOT NULL,
    name VARCHAR(255),
    model INTEGER
);
CREATE TABLE customer(
    id BIGINT PRIMARY KEY     NOT NULL,
    name VARCHAR(255),
    email VARCHAR(255)
);

CREATE TABLE book(
    id BIGINT PRIMARY KEY  NOT NULL,
    name VARCHAR(255),
    customeid BIGINT,
    FOREIGN KEY (customer_id) REFERENCES customer (id)
);

second one : Write localhost:8182/insert to insert data on database.

localhost:8182/books    localhost:8182/book/{id}   localhost:8182/customers   localhost:8182/customer/{id}

13 - Spring-Boot-13-SpringData-3-JPA-Hibernate-PostgreSQL

how to use @Embeddable, @Embedded for Spring data on Spring Boot
first one : create bottom table on any database called Users in pgAdmin 4.
if you change database's name. you can change.

CREATE TABLE car(
    id BIGINT PRIMARY KEY     NOT NULL,
    name VARCHAR(255),
    model INTEGER,
    details VARCHAR(255)
);

second one : First write localhost:8182/insert_car to insert data on database.

localhost:8182/insert_car    

Then write other links such as

for Post method on Postman                  localhost:8182/car
for Put and Delete method on Postman        localhost:8182/car/{id}

Also write these links on Any Browser

localhost:8182/car1/{id}                localhost:8182/car2/{id}
localhost:8182/car_with_name/{name}     localhost:8182/car_with_model/{model}

14 - Spring-Boot-14-SpringData-4-Thymeleaf-JPA-PostgreSQL

how to use @OneToMany and @ManyToOne for spring boot and data in multiple table.
how to use Thymeleaf with jpa hibernate on spring boot.
first one : create bottom table on any database called Users in pgAdmin 4.
if you change database's name. you can change.

CREATE TABLE customer(
    id BIGINT PRIMARY KEY     NOT NULL,
    name VARCHAR(255),
    email VARCHAR(255),
    enabled boolen,
    password VARCHAR(255)
);
CREATE TABLE customer_role(
    id BIGINT PRIMARY KEY  NOT NULL,
    role_name VARCHAR(255),
    customeid BIGINT,
    FOREIGN KEY (customer_id) REFERENCES customer (id)
);

second one : Write localhost:8182/rest/insert to insert data on database.

localhost:8182/customers    localhost:8182/rest/customers   localhost:8182/rest/cust

15 - Spring-Boot-15-SpringSecurity-(Simple)-JPA-PostgreSQL (with Static user and password)

How to use spring security and @Secured @Query with static user and password datas on spring boot and WebSecurityConfigurerAdapter.

  • How will database's table be generated automatically. Look at this applicaton.properties pls. Database's table can be generated automatically, İf you write spring.jpa.hibernate.ddl-auto=create on application.properties on line 15.
  • First you must run this project. database tables will be generated automatically after PgAdmin4 open.
    but table is here
CREATE TABLE customer(
    id BIGINT PRIMARY KEY     NOT NULL,
    name VARCHAR(255),
    email VARCHAR(255),
    enabled boolen,
    password VARCHAR(255)
);
CREATE TABLE customer_role(
    id BIGINT PRIMARY KEY  NOT NULL,
    role_name VARCHAR(255),
    customeid BIGINT,
    FOREIGN KEY (customer_id) REFERENCES customer (id)
);

How to use spring security and @Secured("..."). look at this webConfigurationClass.java on Spring-Boot-15-SpringSecurity-(Simple)-JPA-PostgreSQL/src/main/java/com/example/demo/
You can use user and password to login when you run this project webConfigurationClass.java

  USER     / PASSWORD     / ROLE
-------------------------------------------
- admin    / admin        / "ADMIN"
- celal    / celal        / "USER"
- arda     / arda         / "EDITOR"

Accessing links for roles

Permitall links
localhost:8182/userinfo/

for ADMIN, ADMIN can access these links
localhost:8182/rest/customers/

for USER, USER can acces these links
localhost:8182/rest/customers/      localhost:8182/rest/customer-by-email/{email}/
localhost:8182/customer/{email}/    localhost:8182/rest/customerbyname/{name]   

for EDITOR, EDITOR can acces these links
localhost:8182/rest/cust/   localhost:8182/rest/customer-by-name/{name}/

16 - Spring-Boot-16-SpringData-5-Thymeleaf-JPA-PostgreSQL

how to use @ManyToMany and @JoinTable for spring boot and data in multiple table.

  • You had bettet to look at this applicaton.properties pls. Database's table can be generated automatically, İf you write spring.jpa.hibernate.ddl-auto=create on application.properties.
  • your database's table can create regularly when you wrote spring.jpa.hibernate.ddl-auto=create on application.properties
CREATE TABLE student(
    id INTEGER PRIMARY KEY     NOT NULL,
    name VARCHAR(255),
);
CREATE TABLE subject(
    id INTEGER PRIMARY KEY  NOT NULL,
    name VARCHAR(255)
);

17 - Spring-Boot-17-SpringSecurity-Jpa-PostgreSQL

How to use registering and login on spring boot and security with mysql.

  • You had bettet to look at this applicaton.properties pls. Database's table can be generated automatically, İf you write spring.jpa.hibernate.ddl-auto=create on application.properties.
  • your database's table can create regularly when you wrote spring.jpa.hibernate.ddl-auto=create on application.properties
  • if you wanna to watch the video as result of this project you can click and watch on youtube Watch the video
Using Tools & Technologies
- Spring Boot
- Spring Security
- Jpa, Hibernate
- Mysql
- Thymeleaf
- Bootstrap

23 - Spring-Boot-23-Base-Model-Inheritance PostgreSQL

  • How to use Base Model Inheritance in Multible model with PostgreSQL
  • how to use @Inheritance(....) Annotations with One to many relations
  • Look at link :
  • [Look at this class: Transaction
    @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
Using Tools & Technologies
- Spring Boot
- Jpa, Hibernate
- PostgreSQL
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].