Table of Contents |
---|
Key Points
- Spring saves work but adds work - need to fit to use cases
JHipster is a development platform to generate, develop and deploy Spring Boot + Angular / React / Vue Web applications and Spring microservices.
JHipster is open-source
References
...
https://s3.amazonaws.com/baeldung.com/Persistence+with+Spring.pdf?__s=dks6vftyyy
n6rnaspucsspring-Persistence+with+Spring.pdf
...
Spring Persistence Overview
...
https://s3.amazonaws.com/baeldung.com/Building+a+REST+API+with+Spring.pdf?
__s=dks6vftyyyn6rnaspucs
...
spring-REST-Building+a+REST+API+with+Spring.pdf
...
Build Spring REST services
...
...
Spring Cookbook
...
Simple Aspects using Annotations in Grails _ Man Builds Website.pdf
...
Grails and Spring Aspect
...
spring-6-.io-A Java 17 and Jakarta EE 9 baseline for Spring Framework 6.pdf
spring-6-.io-A Java 17 and Jakarta EE 9 baseline for Spring Framework 6
...
https://stackify.com/spring-boot-level-up/
https://drive.google.com/open?id=1_NfWcLnIABOD0KQ8khcktS3qn_rfblHM
...
https://www.baeldung.com/spring-vs-spring-boot
https://drive.google.com/open?id=1dGQuibfgkwxlKoGkXUYLfGldLF_HLiyO
...
https://www.springboottutorial.com/spring-boot-vs-spring-mvc-vs-spring
https://drive.google.com/open?id=1T1BODw5dkSWlfpZnmRlN6YyCQzn_kXhM
...
https://developer.okta.com/blog/2021/05/12/spring-boot-r2dbc
R2DBC and Spring for Non-Blocking Database Access pdf
...
Master Microservices with Spring Boot and Spring Cloud
...
https://speakerdeck.com/mraible/front-end-development-for-back-end-java-
developers-jfokus-2020
Front_End_Development_for_Back_End_Java_Developers_-_Jfokus_2020.pdf
...
https://res.cloudinary.com/snyk/image/upload/v1534422834/blog/
Spring_Boot_Security_Cheat_Sheet.pdf
Spring_Boot_Security_Cheat_Sheet.pdf
...
https://developer.okta.com/blog/2020/04/15/spring-cloud-stream
spring-cloud-stream-for-messaging-developer.okta.com-A
Quick Guide to Spring Cloud Stream.pdf
...
https://www.slideshare.net/JesusPerezFranco/spring-security-5?from_action=save
springsecurity-v5-181008152249.pdf
...
https://docs.spring.io/spring-security/site/docs/5.2.2.BUILD-SNAPSHOT/reference/htmlsingle/
https://docs.spring.io/spring-security/site/docs/current/reference/htmlsingle/
...
https://howtodoinjava.com/spring-webflux/spring-webflux-tutorial/
spring-webflux-tutorial-howtodoinjava.com-Spring WebFlux Tutorial.pdf
...
Table of Contents |
---|
Key Points
- Spring saves work but adds work - need to fit to use cases
JHipster is a development platform to generate, develop and deploy Spring Boot + Angular / React / Vue Web applications and Spring microservices.
JHipster is open-source
References
Key Concepts
Spring Training resources
...
...
...
course/microservices-with-spring-boot-and-spring-cloud/learn/lecture/8004660#overview
Spring Concepts
...
...
JHipster - oss
...
https://en.wikipedia.org/wiki/JHipster
...
Spring Framework
- Spring 5 Tutorials
- Spring Core Tutorials
- Spring Boot Tutorials
- Spring Batch Tutorials
- Spring Cloud Tutorials
- Spring AOP Tutorials
- Spring MVC Tutorials
- Spring Security Tutorials
- Spring ORM Tutorials
- Spring REST Tutorials
- Spring WebFlux Tutorials
Spring Core
Dependency Injection, AOP, beans
- Spring Bean Java Config Example
- Spring Bean XML Config Example
- Spring Bean Eager vs Lazy Initialization
- Spring bean scopes
Spring Boot
...
...
...
...
...
...
...
...
...
...
...
...
...
...
JHipster 6 and Java 12 overview
has: Openid and CRUD features
...
https://www.infoq.com/minibooks/jhipster-mini-book-5
https://drive.google.com/file/d/1hRMArtWHBOFXYRWpKSXacxuyzwaoZa5c/
view?usp=sharing
...
JHipster mini book
...
https://developer.okta.com/blog/2018/11/26/spring-boot-2-dot-1-oidc-
oauth2-reactive-apis
...
SpringBoot oid, oauth2 support
...
https://www.jhipster.tech/#/learn
...
Learn JHipster
...
https://www.jhipster.tech/#/learn
...
Great set of modules and blueprints:
docker, swagger, ionic etc
...
https://developer.okta.com/blog/2019/05/15/spring-boot-login-options
...
Spring Boot authentication options
?? is this all ?? oauth2 no okta ??
...
https://developer.okta.com/blog/2019/05/13/angular-8-spring-boot-2
...
Basic CRUD app with Java, Spring and Angular 8
...
https://drive.google.com/open?id=1RjS0Lxazvix68o2tdMWIjWoV-L0ugODt
...
java-Front_End_Development_for_Back_End_Java_Developers_-_NYJavaSIG_2019.pdf
...
Build Mobile Apps with Angular, Ionic 4, and Spring Boot
...
Spring RDBC - Reactive Database Connector Framework
synch vs asynch like GORM
...
Key Concepts
Spring Training resources
Spring Concepts
Spring Framework
- Spring 5 Tutorials
- Spring Core Tutorials
- Spring Boot Tutorials
- Spring Batch Tutorials
- Spring Cloud Tutorials
- Spring AOP Tutorials
- Spring MVC Tutorials
- Spring Security Tutorials
- Spring ORM Tutorials
- Spring REST Tutorials
- Spring WebFlux Tutorials
Spring Core
Dependency Injection, AOP, beans
- Spring Bean Java Config Example
- Spring Bean XML Config Example
- Spring Bean Eager vs Lazy Initialization
- Spring bean scopes
Spring Boot
https://howtodoinjava.com/spring-5-tutorial/
https://spring.io/blog/2013/08/06/spring-boot-simplifying-spring-for-everyone
We are pleased to announce the first milestone release of a new project called Spring Boot.
Spring Boot aims to make it easy to create Spring-powered, production-grade applications and services with minimum fuss. It takes an opinionated view of the Spring platform so that new and existing users can quickly get to the bits they need. You can use it to create stand-alone Java applications that can be started using ‘java -jar’
or more traditional WAR deployments. We also provide a command line tool that runs ‘spring scripts’.
The diagram below shows Spring Boot as a point of focus on the larger Spring ecosystem. It presents a small surface area for users to approach and extract value from the rest of Spring:
The primary goals of Spring Boot are:
- To provide a radically faster and widely accessible ‘getting started’ experience for all Spring development
- To be opinionated out of the box, but get out of the way quickly as requirements start to diverge from the defaults
- To provide a range of non-functional features that are common to large classes of projects (e.g. embedded servers, security, metrics, health checks, externalized configuration)
Spring Boot does not generate code and there is absolutely no requirement for XML configuration.
Spring Scripts
Spring Boot ships with a small command line application that can be used to run ‘spring scripts’. Spring scripts are written in Groovy, which means that you have a familiar Java-like syntax, without so much boilerplate code. We are able to deduce a lot of information simply by looking at the way you have written your script. For example, here is a simple web application:
@Controller
class ThisWillActuallyRun {
@RequestMapping("/")
@ResponseBody
String home() {
return "Hello World!"
}
}
When you run this application using ‘spring run webapp.groovy’
a number things are happening:
- Your script is enhanced with common
‘import’
statements to save you typing them - We recognize the
@ResponseBody
annotation and download appropriate Spring JARs - We automatically create the Spring
@Configuration
that you would otherwise need to write - We start up an embedded servlet container and handle incoming requests on port 8080
The command line tool recognizes a number of different types of Spring Applications, including Web, Batch and Integration. There are a number of samples available in the GitHub repository.
Spring Boot with Java
You don’t need use the command line tool or write Groovy code to get the benefits of Spring Boot. We also have first class Java support. For example, here is the same application written in Java:
import org.springframework.boot.*;
import org.springframework.boot.autoconfigure.*;
import org.springframework.stereotype.*;
import org.springframework.web.bind.annotation.*;
@Controller
@EnableAutoConfiguration
public class SampleController {
@RequestMapping("/")
@ResponseBody
String home() {
return "Hello World!";
}
public static void main(String[] args) throws Exception {
SpringApplication.run(SampleController.class, args);
}
}
Other than import statements, the main difference between this example and the earlier Groovy script is the main()
method that calls SpringApplication
and the @EnableAutoConfiguration
annotation.
Obviously with Java you also need a build system to compile and package your code. We provide a number of convenient ‘starter’ POMs that you can use with Maven, Gradle or Ant+Ivy to
Getting Started with Spring Boot and Spring Cloud
https://www.udemy.com/course/microservices-with-spring-boot-and-spring-cloudeveryone
We are pleased to announce the first milestone release of a new project called Spring Boot.
Spring Boot aims to make it easy to create Spring-powered, production-grade applications and services with minimum fuss. It takes an opinionated view of the Spring platform so that new and existing users can quickly get to the bits they need. You can use it to create stand-alone Java applications that can be started using ‘java -jar’
or more traditional WAR deployments. We also provide a command line tool that runs ‘spring scripts’.
The diagram below shows Spring Boot as a point of focus on the larger Spring ecosystem. It presents a small surface area for users to approach and extract value from the rest of Spring:
The primary goals of Spring Boot are:
- To provide a radically faster and widely accessible ‘getting started’ experience for all Spring development
- To be opinionated out of the box, but get out of the way quickly as requirements start to diverge from the defaults
- To provide a range of non-functional features that are common to large classes of projects (e.g. embedded servers, security, metrics, health checks, externalized configuration)
Spring Boot does not generate code and there is absolutely no requirement for XML configuration.
Spring Scripts
Spring Boot ships with a small command line application that can be used to run ‘spring scripts’. Spring scripts are written in Groovy, which means that you have a familiar Java-like syntax, without so much boilerplate code. We are able to deduce a lot of information simply by looking at the way you have written your script. For example, here is a simple web application:
@Controller
class ThisWillActuallyRun {
@RequestMapping("/")
@ResponseBody
String home() {
return "Hello World!"
}
}
When you run this application using ‘spring run webapp.groovy’
a number things are happening:
- Your script is enhanced with common
‘import’
statements to save you typing them - We recognize the
@ResponseBody
annotation and download appropriate Spring JARs - We automatically create the Spring
@Configuration
that you would otherwise need to write - We start up an embedded servlet container and handle incoming requests on port 8080
The command line tool recognizes a number of different types of Spring Applications, including Web, Batch and Integration. There are a number of samples available in the GitHub repository.
Spring Boot with Java
You don’t need use the command line tool or write Groovy code to get the benefits of Spring Boot. We also have first class Java support. For example, here is the same application written in Java:
import org.springframework.boot.*;
import org.springframework.boot.autoconfigure.*;
import org.springframework.stereotype.*;
import org.springframework.web.bind.annotation.*;
@Controller
@EnableAutoConfiguration
public class SampleController {
@RequestMapping("/")
@ResponseBody
String home() {
return "Hello World!";
}
public static void main(String[] args) throws Exception {
SpringApplication.run(SampleController.class, args);
}
}
Other than import statements, the main difference between this example and the earlier Groovy script is the main()
method that calls SpringApplication
and the @EnableAutoConfiguration
annotation.
Obviously with Java you also need a build system to compile and package your code. We provide a number of convenient ‘starter’ POMs that you can use with Maven, Gradle or Ant+Ivy to
Getting Started with Spring Boot and Spring Cloud
https://www.udemy.com/course/microservices-with-spring-boot-and-spring-cloud
JUST - new CLI for Spring Boot
https://www.infoq.com/news/2023/01/just-spring-boot-cli/
JUST getting started docs
https://just.maciejwalkowiak.com/docs/getting-started/
Just, a command line tool requiring zero configuration, increases the Java development experience while building Spring Boot applications. Just automatically reloads the application when there is a change in source code, build files or Docker compose files. The project also supports the creation of (native) applications and (native) Docker images.
Maciej Walkowiak, Freelance Architect & Developer, released Just exactly eleven months after the first commit. Just itself is a Spring Boot application compiled to a native binary which uses: picocli to create a rich command line application; Testcontainers to run containers in JUnit tests; Sentry for error monitoring; and JReleaser to release the project.
Just uses Spring Boot Devtools which reloads the application after the source code is changed and a build is triggered. On top of Spring Boot Devtools, Just automatically detects source code changes and compiles those changes. Furthermore, whenever the pom.xml
or build.gradle
change, the application is stopped, the build file refreshed and the application is started again. Unlike Spring Boot Devtools, Just also starts infrastructure services such as databases and services defined via Docker Compose whenever the run
sub-command is executed. Just automatically detects the applications build configuration and uses it whenever a just
command is executed. It supports Maven and Gradle, but also their respective wrappers and the Maven Daemon. Just execute the run
sub-command once and it takes care of the changes in the application.
Comparable to the run
sub-command, the build
sub-command is translated to the proper Maven or Gradle command with the correct build goal:
just build [--quick] [--skip-test] <buildTarget>
The quick
option skips tests, document generation and checks such as formatting and static analysis. Just offers several buildTarget
options to create a (native) application or a (native) Docker image: jar
, native
, image
and native-image
.
Based on the project's configuration, the format
sub-command formats the codebase following the rules of the default settings, Spring Java Format or Spotless configuration.
A running process may be killed with the kill
sub-command. By default, the process running on port 8080 is killed. Optionally, a port may be specified with the -p
argument and the kill
sub-command may be forced by supplying the -9
argument.
Just can be run from the command line or from IntelliJ IDEA by adding a run configuration by executing the init idea
sub-command. Alternatively, the run configuration may be added manually by opening the configuration via the Run menu option and clicking on Edit Configurations. Now add a Shell Script and specify the name. The Execute option should be set to Shell Script and the Script Text to just run
. After unchecking the Execute in the terminal option, the configuration can be applied. Now the Run menu option shows the name of the new shell script which can be used to start Just.
Just may be installed on MacOs with Homebrew:
brew install maciejwalkowiak/brew/just
Or on Windows with Scoop:
scoop bucket add maciejwalkowiak https://github.com/maciejwalkowiak/scoop-just.git
scoop install just
Alternatively, the application may be installed manually on macOS, Windows or Linux, for example via the Linux command:
curl -Lo just.zip https://github.com/maciejwalkowiak/just/releases/latest/download/just-0.12.0-linux-x86_64.zip && unzip just.zip && chmod +x just && sudo mv just /usr/local/bin/just && just help
The help
sub-command may be used to verify the installation.
Just is not an open source project. The GitHub repository contains the binaries, release notes and issue tracker, but not the source code. Currently, the project is still in alpha status and available for free. Each release has a built-in expiration date, after which the application may be purchased or the latest release may be installed.
Spring Getting Started Guides - go here for specific framework tutorials
...
Configuration using lambdas
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests(authorizeRequests ->
authorizeRequests
.antMatchers("/blog/**").permitAll()
.anyRequest().authenticated()
)
.formLogin(formLogin ->
formLogin
.loginPage("/login")
.permitAll()
)
.rememberMe(withDefaults());
}
}
Equivalent configuration without using lambdas
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/blog/**").permitAll()
.anyRequest().authenticated()
.and()
.formLogin()
.loginPage("/login")
.permitAll()
.and()
.rememberMe();
}
}
Lambda DSL configuration tips
...
You may also configure WebFlux security using lambdas in a similar manner.
Below is an example configuration using lambdas.
@EnableWebFluxSecurity
public class SecurityConfig {
@Bean
SecurityWebFilterChain springSecurityFilterChain(ServerHttpSecurity http) {
http
.authorizeExchange(exchanges ->
exchanges
.pathMatchers("/blog/**").permitAll()
.anyExchange().authenticated()
)
.httpBasic(withDefaults())
.formLogin(formLogin ->
formLogin
.loginPage("/login")
);
return http.build();
}
}
Goals of the Lambda DSL
The Lambda DSL was created to accomplish to following goals:
...