Spring Boot 30 Crash Course Mastering Spring
Boot From Application Development To Advanced
Security Data Access Integration And Deployment
download
https://ebookbell.com/product/spring-boot-30-crash-course-
mastering-spring-boot-from-application-development-to-advanced-
security-data-access-integration-and-deployment-58709300
Explore and download more ebooks at ebookbell.com
Here are some recommended products that we believe you will be
interested in. You can click the link to download.
Spring Boot 30 Cookbook Proven Recipes For Building Modern And Robust
Java Web Applications With Spring Boot 1st Edition Felip Miguel Puig
https://ebookbell.com/product/spring-boot-30-cookbook-proven-recipes-
for-building-modern-and-robust-java-web-applications-with-spring-
boot-1st-edition-felip-miguel-puig-58534736
Spring Boot 30 Cookbook Proven Recipes For Building Modern And Robust
Java Web Applications With Spring Boot Felip Miguel Puig
https://ebookbell.com/product/spring-boot-30-cookbook-proven-recipes-
for-building-modern-and-robust-java-web-applications-with-spring-boot-
felip-miguel-puig-58439478
Spring Boot 30 Cookbook Proven Recipes For Building Modern And Robust
Java Web Applications With Spring Boot Felip Miguel Puig
https://ebookbell.com/product/spring-boot-30-cookbook-proven-recipes-
for-building-modern-and-robust-java-web-applications-with-spring-boot-
felip-miguel-puig-58466608
Spring Boot 30 Cookbook Felip Miguel Puig
https://ebookbell.com/product/spring-boot-30-cookbook-felip-miguel-
puig-200655718
Learning Spring Boot 30 Third Edition Greg L Turnquist
https://ebookbell.com/product/learning-spring-boot-30-third-edition-
greg-l-turnquist-47823514
Mastering Spring Boot 30 A Comprehensive Guide To Building Scalable
And Efficient Backend Systems With Java And Spring Ahmet Meric
https://ebookbell.com/product/mastering-spring-
boot-30-a-comprehensive-guide-to-building-scalable-and-efficient-
backend-systems-with-java-and-spring-ahmet-meric-200681856
Mastering Spring Boot 30 A Comprehensive Guide To Building Scalable
And Efficient Backend Systems With Java And Spring Ahmet Meric
https://ebookbell.com/product/mastering-spring-
boot-30-a-comprehensive-guide-to-building-scalable-and-efficient-
backend-systems-with-java-and-spring-ahmet-meric-58179160
Mastering Spring Boot 30 Ahmet Meric
https://ebookbell.com/product/mastering-spring-boot-30-ahmet-
meric-146572384
Spring Boot 3 Recipes A Problemsolution Approach For Java
Microservices And Cloudnative Applications 2nd Marten Deinum
https://ebookbell.com/product/spring-boot-3-recipes-a-problemsolution-
approach-for-java-microservices-and-cloudnative-applications-2nd-
marten-deinum-56416454
Spring Boot 3.0 Crash Course
Mastering Spring Boot, from Application Development to Advanced
Security, Data Access, Integration and Deployment
Kit Harrington
Preface
This Spring Boot 3.0 Crash Course will teach you all you need to know to
create powerful Spring applications with the latest version of the
framework. You will be able to create any feature that an application may
require because this book covers everything from the fundamentals to
advanced features.
First things first: get your development environment ready and build your
very first Spring Boot App. Data access, security, configuration, and
testing are some of the more advanced subjects you'll cover as you go
along. This crash course will teach you how to create RESTful services,
use Spring Data JPA to integrate different types of data, and work with
properties and YAML files to oversee configurations. You practice
to manage application properties, get into the application of annotations,
and master the Spring MVC architecture. It will teach you to manage form
submissions, validate user input, and construct dynamic web pages using
Thymeleaf templates. The book also covers topics like integrating front-
end frameworks, handling errors, and deploying applications to cloud
platforms and Kubernetes.
Issues with configuring URL authorization, implementing JWT
authentication, and integrating with OAuth2 and OpenID Connect are
some of the critical problems that are being solved in this book. Methods
for troubleshooting auto-configuration issues, managing environment
variables in Docker, and making use of performance testing tools such as
JMeter are all topics that will be covered. Additionally, the book delves
into the topic of how to integrate with Active Directory and LDAP for
centralized user management and authentication.
By the time you finish this book, you will know everything there is to
know about Spring Boot application development, security, and
deployment, so you can confidently take on real-world projects.
In this book you will learn how to:
Discover the ins and outs of efficiently configuring a Spring Boot 3.0
development environment.
Integrate various data sources and construct strong RESTful services with
the help of Spring Data JPA.
Get to know Spring Boot's properties and YAML files to set up
customizable apps.
Use Spring Security and JWT tokens to implement secure authorization
and authentication.
Use Thymeleaf templates to build interactive websites and easily handle
form submissions.
Use Kubernetes and cloud platforms to effortlessly deploy Spring Boot
applications.
Make your apps more up-to-date and responsive by incorporating front-
end frameworks such as Angular and React.
Put thorough error handling strategies into your applications and handle
errors gracefully.
Use Docker to manage environment variables and JMeter to optimize
application performance.
Prologue
Thank you for choosing our Spring Boot 3.0 Crash Course. Hi, I'm Kit
Harrington, and I'm really excited to show you how to use Spring Boot
3.0. Allow me to begin by relating a tale that exemplifies why this book is
so important.
A fast-growing tech startup had me as their project manager a few years
back. The success of the business hinged on creating a safe, scalable, and
reliable app that could manage thousands of users with ease. These lofty
expectations were squarely on my shoulders as lead developer. The
complexity of integrating different technologies, guaranteeing security,
and optimizing performance was a challenge for me, even though I have a
lot of experience in this area. I started using Spring Boot as my primary
tool at that point. An easier way to build apps using the Spring framework
was made available by Spring Boot. I was able to focus on creating
effective code because it made setting everything up and running much
easier. Thanks to Spring Boot's robust capabilities, we were able to build
and deploy features at an incredible pace. Mastering Spring Boot, though,
necessitated familiarity with its foundational concepts, recommended
practices, and more complex features.
That experience is the foundation of this book. I hope that by sharing what
I've learned and the solutions I've found, you'll be able to build your
Spring Boot applications with ease and confidence. In this book, I'll show
you how to build an app using Spring Boot from the ground up, including
all the necessary features and making sure it's secure, scalable, and fast.
You may find at times repetition of steps while demonstrating practical
examples, so apology in advance but the intention is to ensure you dont
get stuck in the middle of coding the application.
In this first step, you will build your first Spring Boot app and configure
your development environment. The course will teach you the ins and outs
of dependency management, application configuration via properties and
YAML files, and more. Annotations, data source integration with Spring
Data JPA, and RESTful service construction are some of the more
advanced topics that we will cover as we go along. I will demonstrate how
to incorporate Spring Security authentication and authorization, two
essential components of any application. In this lesson, you will find out
how to secure your application from intruders by configuring basic
authentication, URL authorization, and JWT authentication.
Also covered will be the basics of working with Thymeleaf templates to
build dynamic web pages, accept and process form submissions, and
check user input. Learn the ins and outs of integrating popular front-end
frameworks such as Angular and React to create cutting-edge, mobile-
friendly apps. I will show you how to package your app, make Docker
images, and deploy them to cloud platforms and Kubernetes—all of which
are essential steps in the development process. Managing environment
variables and achieving zero downtime during deployments are topics
you'll cover in this course. Using JMeter for performance testing, I will
demonstrate how to optimize performance, which is essential for deliver
ing an excellent user experience. You will gain knowledge on how to
locate performance issues and enhance your application to its full
potential.
With the knowledge and skills, you gain from this book, you will be able
to confidently construct applications that are strong, secure, and perform
well. So that you can put what you learn into practice right away, I want to
equip you with practical knowledge and real-world examples.
Come on, let's start making awesome Spring Boot apps!
Copyright Š 2024 by GitforGits
All rights reserved. This book is protected under copyright laws and no
part of it may be reproduced or transmitted in any form or by any means,
electronic or mechanical, including photocopying, recording, or by any
information storage and retrieval system, without the prior written
permission of the publisher. Any unauthorized reproduction, distribution,
or transmission of this work may result in civil and criminal penalties and
will be dealt with in the respective jurisdiction at anywhere in India, in
accordance with the applicable copyright laws.
Published by: GitforGits
Publisher: Sonal Dhandre
www.gitforgits.com
support@gitforgits.com
Printed in India
First Printing: July 2024
Cover Design by: Kitten Publishing
For permission to use material from this book, please contact GitforGits at
support@gitforgits.com.
Content
Preface
GitforGits
Acknowledgement
Chapter 1: Up and Running with Spring Boot
Chapter Overview
What is Spring Boot?
Emergence of Spring Boot
Relation to Spring Framework
Recent Version
Applications, Programs, and APIs
Key Features of Spring Boot
Auto-configuration
Spring Boot Starters
Embedded Servers
Production-Ready Features
Externalized Configuration
Spring Boot CLI
DevTools
Spring Initializr
Actuator
Spring Boot DevTools
Simplified Dependency Management
Simplified Testing
Application Metrics and Health Checks
Security Integration
Integration with Other Spring Projects
Reactive Programming Support
GraalVM Native Image Support
Setting up Development Environment
Installing JDK
Installing IDE
Installing Apache Maven
Installing Spring Boot CLI
Creating Spring Boot Project
Configuring IDE
Running first Spring Boot App
Exploring Project Structure
Adding Dependencies
Configuring Application Properties
Spring Boot DevTools
Spring Boot CLI
Creating First Spring Boot Application
Setting up the Project
Creating Main Application Class
Creating a REST Controller
Running the Application
Understanding Auto-configuration
Adding Dependency Injection
Exploring Application Properties
Understanding Spring Boot Dependencies
Spring Boot Starters
Maven
Dependency Management
Adding Custom Dependencies
Using Spring Boot DevTools
Dependency Exclusions
Resolving Dependency Conflicts
Using Bill of Materials (BOM)
Upgrading Dependencies
Annotations Overview
Core Annotations
Stereotype Annotations
Configuration and Bean Annotations
Dependency Injection Annotations
Spring MVC Annotations
Data Access Annotations
Testing Annotations
Actuator Annotations
Overview of Spring Boot CLI
Installing Spring Boot CLI
Creating Simple Web App with CLI
Using Spring Boot CLI for Dependency Management
Packaging Applications with Spring Boot CLI
Spring Boot CLI for Existing Projects
Prototyping
Spring Boot CLI Configuration
Spring Boot CLI with Spring Initializr
Spring Boot CLI with Groovy Templates
Summary
Chapter 2: Building First Spring Boot App
Chapter Overview
Creating a Basic RESTful Service
Main Application Class
Creating a REST Controller
Running the Application
Expanding the REST Controller
Handling GET and POST Requests
Implementing GET Requests
Implementing POST Requests
Handling PUT and DELETE Requests
Implementing PUT Requests
Implementing DELETE Requests
Using Path Variables and Request Parameters
Using Path Variables
Using Request Parameters
Using Message Converters
Built-in Message Converters
Sample Program: Working of Message Converters
Spring MVC Architecture Overview
Understanding Spring MVC
Spring MVC Core Components
Sample Program: Inner Workings of MVC Components
Error Handling in Spring Boot
Built-in Error Handling
Customizing Error Responses
Handling Validation Errors
Summary
Chapter 3: Configuration and Properties
Chapter Overview
Spring Boot Configuration Overview
Application Properties
YAML for Structured Configuration
Profiles for Environment-Specific Configurations
Externalizing and Securing Configuration
Using Application Properties
Basic Configuration
Grouping Related Properties
Configuring Logging
Profiles in Application Properties
External Configuration
Using Application Properties
Configuration with YAML Files
Setting up YAML Configuration
Advantages of YAML
Profiles with YAML
Accessing YAML Properties
Profiles and Environment Specific Configurations
Defining Profiles
Activating Profiles
Using Profile-Specific Beans
Combining Profiles
Profile-Specific Configuration Properties
Accessing Profile Information
Externalizing Configuration
Using Environment Variables
Centralized Configuration with Spring Cloud Config
@Value and @ConfigurationProperties
Using @Value
Using @ConfigurationProperties
Binding Complex Nested Properties
Validation with @ConfigurationProperties
Type-Safe Configuration Properties
Setting up Type-Safe Configuration Properties
Advanced Type-Safe Configuration
Reloading Configuration Properties at Runtime
Using Spring Cloud Context
Using Spring Cloud Bus
Handling Configuration Reloads
Monitoring Configuration Changes
Summary
Chapter 4: Spring Boot Packaging and Deployment
Chapter Overview
Packaging a Spring Boot Application
Understanding Executable JAR Files
Understanding Executable WAR Files
Process of Packaging
Automating Packaging Process
Integrating Packaging with CI/CD Pipelines
Creating Executable JAR and WAR Files
Creating an Executable JAR File
Creating an Executable WAR File
Deploying to Tomcat
Install Tomcat and Copy WAR File
Start the Tomcat Server
Verifying Deployment
Hot Deployment and Redeployment
Managing Tomcat Deployments
Automating Deployment with CI/CD
Deploying to Jetty and Undertow
Why Jetty?
Jetty Deployment
Undertow Overview
Undertow Deployment
Deploying to Docker
Deploying Spring Boot Application
Deploying to AWS
Setup EC2 Instance
Install Java on EC2 Instance
Transfer Application JAR/WAR File to EC2
Run Application
Using AWS Elastic Beanstalk
Using AWS Elastic Container Service
Running Apps in Kubernetes
Setting up Kubernetes
Deploying Application to Kubernetes
Creating Spring Boot Docker Images
Workflow for Docker Images
Sample Program: Creation of Docker Images
Summary
Chapter 5: Spring Boot Auto-configuration
Chapter Overview
Understanding Auto-configuration
Auto-configuration Overview
Key Components of Auto-configuration
Sample Program: Auto-configuration using JPA and H2
Customizing Auto-configuration
Overriding Default Beans
Conditional Beans and Customization
Customizing Configuration with @ConfigurationProperties
Customizing Auto-configuration with Custom Annotations
Exploring Spring Boot Starter POMs
Using Conditional Beans
Common Conditional Annotations
Sample Program: Using Conditional Annotations
Writing Custom Auto-configuration
Custom Auto-configuration Workflow
Sample Program: Writing Custom Auto-configuration
Exploring Starter POMs
Common Spring Boot Starter POMs
Sample Program: Using Starter POMs
Summary
Chapter 6: Data Access with Spring Data JPA
Chapter Overview
Introduction to Spring Data JPA
Key Features of Spring Data JPA
Up and Running with Spring Data JPA
Configuring Data Source
Adding Dependencies
Defining Data Source Properties
Creating JPA Entities
Creating Repository Interfaces
Implementing Service Layer
Creating Controller Layer
JPA Entities and Relationships
Defining JPA Entities
One-to-One Relationship
One-to-Many and Many-to-One Relationships
Many-to-Many Relationship
Query Methods and Custom Queries
Defining Query Methods
Writing Custom Queries with @Query
Using JPA Criteria API
Why Criteria API?
Sample Program: Using JPA Criteria API
Paging and Sorting with Spring Data JPA
Brief Overview
Setting up Paging and Sorting
Handling Transactions in Spring Boot
Enabling Transaction Management
Using @Transactional Annotation
Transaction Scenarios
Additional Transaction Management
Integrating with Liquibase and Flyway for Database Migrations
Configuring Liquibase
Configuring Flyway
Performing Database Migrations
Sample Program: Combining Liquibase and Flyway
Summary
Chapter 7: Building Web Applications
Chapter Overview
Introduction to Spring MVC
Model-View-Controller Architecture
Spring MVC Components
Sample Program: Creating a User Management System using Spring
MVC
Creating Controllers and Views
Creating Controllers
Creating Views
Using Thymeleaf Templates
Setting up Thymeleaf
Basic Syntax and Expressions
Creating a User Form with Validation
Implementing User Details View
Adding a CSS File for Styling
Updating the Application to Serve Static Content
Handling Form Submissions
Form Binding with Thymeleaf
Controller Method for Handling Form Submissions
Adding Validation Constraints
Handling Form Submission and Validation Errors
Validating User Input
Adding Validation Constraints to the Entity
Updating Controller to Handle Validation
Updating Form to Display Validation Errors
Utilizing WebSockets
Brief Overview
Configuring WebSockets
File Upload and Download Handling
Configuring File Uploads
Creating a File Upload Controller
Handling File Downloads
Integrating Front-End Frameworks
Integrating React with Spring Boot
Integrating Angular with Spring Boot
Summary
Chapter 8: Testing Spring Boot Applications
Chapter Overview
Getting Started with Testing
Background
Types of Testing
Unit Testing with JUnit and Mockito
Setting up JUnit and Mockito
Example 1: Unit Testing a Service Layer
Example 2: Unit Testing a Controller Layer
Conduct Slice Testing for Layer-Specific Tests
Understanding Layer-Specific Tests
Slice Testing for the Data Layer
Slice Testing for the Web Layer
MockMVC for Web Layer Testing
Introduction to MockMVC
Setting up MockMVC
Sample Program: Using MockMVC
Testing Data Repositories
Types of Data Repositories
Sample Program: Testing Data Repositories
Sample Program: Testing a Custom Repository Method
Testing with TestContainers
Setting up TestContainers
Writing Integration Tests with TestContainers
Performance Testing with JMeter
Introduction to JMeter
Setting up JMeter
Sample Test Plan
Summary
Chapter 9: Security in Spring Boot
Chapter Overview
Explore Spring Security
Introduction to Spring Security
Core Components of Spring Security
Configuring Basic Authentication
Setting up Spring Security
Customizing Basic Authentication
Configuring URL Authorization
Setting up URL Authorization
Customizing Access Denied Handling
Testing the Custom Access Denied Handler
JWT, OAuth and OpenID Connect
Setting up JWT Authentication
Setting up OAuth and OpenID Connect
Integrating with LDAP and Active Directory
Setting up LDAP Integration
Integrating with Active Directory
Summary
Index
Epilogue
GitforGits
Prerequisites
Whether you're a seasoned developer or just getting started, this book
introduces you to geete comfortable with Spring Boot and take the most
benefits of its tools to create high-quality apps quickly. All you need is to
be just a basic programming experience with any of the languages to get
started with.
Codes Usage
Are you in need of some helpful code examples to assist you in your
programming and documentation? Look no further! Our book offers a
wealth of supplemental material, including code examples and exercises.
Not only is this book here to aid you in getting your job done, but you
have our permission to use the example code in your programs and
documentation. However, please note that if you are reproducing a
significant portion of the code, we do require you to contact us for
permission.
But don't worry, using several chunks of code from this book in your
program or answering a question by citing our book and quoting example
code does not require permission. But if you do choose to give credit, an
attribution typically includes the title, author, publisher, and ISBN. For
example, "Spring Boot 3.0 Crash Course by Kit Harrington".
If you are unsure whether your intended use of the code examples falls
under fair use or the permissions outlined above, please do not hesitate to
reach out to us at
We are happy to assist and clarify any concerns.
Chapter 1: Up and Running with Spring Boot
Chapter Overview
Let us start with our first chapter, "Up and Running with Spring Boot,"
which will serve as the foundation for your skill-building transition into
Spring Boot. This chapter will walk you through the core concepts and
essential features that make Spring Boot a powerful framework for
developing robust applications. You'll start by learning about Spring Boot
and how it evolved from the Spring Framework, which will help you
understand why it's so popular among developers today.
As you progress, you'll discover the key features that set Spring Boot apart
from other frameworks. Some of its features include an opinionated
approach to configuration, the ability to build standalone apps, and the
ability to integrate with different technologies seamlessly. Understanding
these features will help you appreciate the efficiency and simplicity that
Spring Boot adds to application development. You will then proceed to set
up your development environment, ensuring that all required tools are
installed and configured. This includes configuring your IDE, JDK, and
other essential components. Following that, you will create your first
Spring Boot application, giving you hands-on experience with the
framework's capabilities. This practical approach will be supplemented by
exploring Spring Boot dependencies and starter projects, which make
dependency management and project setup easier.
Finally, the chapter will go over Spring Boot annotations and the Spring
Boot CLI. By the end of this chapter, you will have a solid understanding
of Spring Boot, allowing you to delve deeper into its advanced features
and capabilities in the following chapters.
What is Spring Boot?
Spring Boot has gained significant traction among developers for its
ability to simplify the creation of stand-alone, production-grade Spring-
based applications. It has become synonymous with rapid application
development, offering a set of tools and features that streamline the entire
development process. The modern developer community appreciates
Spring Boot for its minimal setup, reduced boilerplate code, and the
seamless integration it provides with other technologies.
Emergence of Spring Boot
Spring Boot emerged as an enhancement to the Spring Framework,
addressing some of the complexities and configuration challenges
developers faced with traditional Spring applications. The Spring
Framework, introduced in 2003, brought a revolutionary approach to Java
development by promoting loose coupling through dependency injection
and aspect-oriented programming. However, as the Spring ecosystem
grew, configuring and deploying Spring applications became increasingly
intricate. This is where Spring Boot comes into play.
Spring Boot was introduced to tackle these challenges by providing a
convention-over-configuration approach. It simplifies the development
process by offering default configurations and sensible defaults, which can
be customized as needed. This allows developers to focus more on writing
business logic rather than dealing with complex configurations.
Relation to Spring Framework
Spring Boot is essentially built on top of the Spring Framework,
leveraging its core principles and components while abstracting much of
the boilerplate configuration. This relationship ensures that Spring Boot
applications inherit the robust and flexible nature of the Spring
Framework but with added ease of use and productivity enhancements.
At its core, Spring Boot provides:
● Pre-configured dependencies for various functionalities, reducing
the need for manual dependency management.
Automatically configures your application based on the dependencies you
have added, ensuring minimal configuration effort.
Enables the creation of stand-alone applications that can run
independently without the need for an external web server.
● Integrates features like metrics, health checks, and externalized
configuration out of the box.
Recent Version
Spring Boot has evolved significantly across its three major versions, each
bringing new features, improvements, and refinements.
Spring Boot 1.x
The first major release focused on establishing the foundation of the
framework. It introduced key features like auto-configuration, starter
dependencies, and embedded servers. This version laid the groundwork
for making Spring applications easier to create and deploy.
Spring Boot 2.x
Building on the success of the 1.x series, Spring Boot 2.0 brought several
enhancements. These included improved support for reactive
programming with Spring WebFlux, enhanced Actuator endpoints for
better monitoring, and integration with newer versions of the Spring
Framework and other third-party libraries. The 2.x series also saw a focus
on performance improvements and updated default configurations.
Spring Boot 3.x
The latest major release, Spring Boot 3.0, continues to refine the
framework with modern features and support for the latest Java versions.
It embraces new standards and best practices in the Java ecosystem, such
as better support for GraalVM native images, enhanced observability with
Micrometer, and further improvements in performance and memory
management. Spring Boot 3.x also introduces new tools and integrations
that align with contemporary development needs, such as better cloud-
native support and advanced security features.
Applications, Programs, and APIs
Spring Boot is widely used for developing robust web applications. Its
integration with Spring MVC allows developers to create RESTful
services with ease, handling various HTTP methods and providing
JSON/XML responses out of the box. The microservices architecture has
also gained popularity, and Spring Boot is a natural fit for building
microservices. Its lightweight nature and ability to create stand-alone
applications make it ideal for developing small, independent services that
can be deployed and scaled individually. It is also commonly used to
develop APIs that expose business logic and services to other applications.
The ease of creating RESTful endpoints, along with features like Spring
Security for securing APIs, makes it a preferred choice for API
development.
Spring Boot integrates with Spring Batch to facilitate batch processing,
allowing for the development of applications that handle large volumes of
data processing jobs. This is particularly useful in scenarios like data
migration, ETL (Extract, Transform, Load) operations, and periodic tasks.
With support for various messaging protocols and technologies like
RabbitMQ and Kafka, Spring Boot simplifies the development of
messaging-based applications. This is essential for building event-driven
architectures and real-time data processing systems.
Spring Boot's compatibility with cloud platforms like AWS, Azure, and
Google Cloud Platform makes it an excellent choice for developing cloud-
native applications. Features like externalized configuration, seamless
integration with cloud services, and support for containerization through
Docker make Spring Boot a powerful tool for modern cloud deployments.
Spring Boot can also be used to create command-line applications. The
Spring Boot CLI (Command Line Interface) allows for rapid prototyping
and execution of Spring Boot applications directly from the command
line, making it useful for scripting and automation tasks.
Spring Boot supports GraphQL, enabling the development of APIs that
allow clients to request exactly the data they need. This is particularly
beneficial for applications requiring efficient data retrieval and flexible
querying capabilities. And, with the introduction of Spring WebFlux,
Spring Boot supports reactive programming, allowing the creation of
reactive, non-blocking applications. This is particularly useful for building
high-performance, scalable applications that need to handle a large
number of concurrent connections.
Key Features of Spring Boot
Spring Boot's widespread adoption and popularity among developers stem
from its powerful and efficient features that significantly enhance the
development experience. Following are the ost appealing features
highlighting how they simplify application development and improve
productivity:
Auto-configuration
One of the most acclaimed features of Spring Boot is its auto-
configuration capability. Auto-configuration reduces the need for manual
setup by automatically configuring Spring applications based on the
dependencies present on the classpath. For example, if you include a
dependency for a database in your project, Spring Boot will automatically
configure a DataSource bean. This feature drastically minimizes
boilerplate code and configuration files, allowing developers to focus on
writing business logic.
Spring Boot Starters
Spring Boot starters are a set of convenient dependency descriptors that
you can include in your project. They aggregate commonly used
dependencies into a single dependency, simplifying the process of adding
and managing libraries. For instance, the spring-boot-starter-web starter
includes dependencies for Spring MVC, Jackson for JSON processing,
and an embedded Tomcat server. By using starters, you can easily set up a
Spring Boot project without having to manually specify each dependency,
thus speeding up development time.
Embedded Servers
Spring Boot allows you to create stand-alone applications by embedding
web servers like Tomcat, Jetty, or Undertow directly within the
application. This eliminates the need to deploy your application to an
external server. By default, Spring Boot uses Tomcat as the embedded
server, but you can easily switch to Jetty or Undertow if required. This
feature enables rapid development and testing, as you can run your
application directly from your IDE or command line without additional
server configuration.
Production-Ready Features
Spring Boot comes with a variety of built-in features that help you
monitor and manage your application in production environments. The
Actuator module provides a range of endpoints that offer insights into the
application's health, metrics, and configuration. These endpoints can
expose information such as application health status, environment
properties, and metrics like memory usage and request counts.
Additionally, Spring Boot supports integration with external monitoring
tools like Prometheus and Grafana, making it easier to keep an eye on
your application's performance and health.
Externalized Configuration
Managing configuration properties in a flexible and efficient manner is
crucial for any application. Spring Boot's externalized configuration
feature allows you to define configuration properties in various formats,
including properties files, YAML files, environment variables, and
command-line arguments. This flexibility makes it easier to manage
configuration across different environments, such as development, testing,
and production. You can use profiles to group configuration properties and
switch between them seamlessly, ensuring your application behaves
correctly in each environment.
Spring Boot CLI
The Spring Boot Command Line Interface (CLI) is a powerful tool for
rapid prototyping and development. It allows you to write Groovy scripts
to run Spring Boot applications without requiring a full project setup. The
CLI is particularly useful for creating quick prototypes, running small
utilities, or testing out new features. With the Spring Boot CLI, you can
quickly create and execute Spring Boot applications directly from the
command line, making it a handy tool for developers who need to test and
experiment rapidly.
DevTools
Spring Boot DevTools is a development-time feature that enhances the
developer experience by providing tools and utilities that streamline the
development process. One of the key features of DevTools is automatic
restart, which reloads the application context whenever there are changes
in the classpath. This reduces the time spent restarting the application
manually. DevTools also includes features like live reload, which
refreshes the browser automatically when resources change, and remote
debugging support, allowing you to debug your application running in a
remote environment.
Spring Initializr
Spring Initializr is an online tool that helps you bootstrap a new Spring
Boot project quickly. It provides a web-based interface where you can
select the desired project metadata, dependencies, and other options. Once
you specify your preferences, Spring Initializr generates a fully configured
Spring Boot project that you can download and import into your IDE. This
tool simplifies the initial setup process, enabling developers to start coding
their applications immediately.
Actuator
Spring Boot Actuator is a set of production-ready features that help you
monitor and manage your Spring Boot application. It provides various
endpoints that expose application health, metrics, info, environment
properties, and other operational details. These endpoints can be
customized to control which information is exposed and who can access
it. Actuator is essential for gaining insights into the application’s runtime
behavior and health, making it easier to detect and diagnose issues in
production environments.
Spring Boot DevTools
Spring Boot DevTools is a development-time module that boosts
developer productivity by providing features like automatic restarts, live
reload, and configurations for debugging. Automatic restarts help reduce
the time spent on manual restarts after code changes, while live reload
refreshes the browser automatically when static resources are modified.
DevTools also simplifies remote debugging, allowing you to connect your
debugger to a running application without complex setup.
Simplified Dependency Management
Spring Boot simplifies dependency management by providing a set of
starter POMs that bundle commonly used dependencies. These starters
reduce the complexity of managing dependencies individually and ensure
compatibility between different library versions. For instance, adding the
spring-boot-starter-data-jpa starter includes dependencies for Spring Data
JPA, Hibernate, and a database connection pool, all of which are tested to
work well together.
Simplified Testing
Testing is a crucial part of application development, and Spring Boot
makes it easier by providing extensive support for unit and integration
testing. Spring Boot integrates seamlessly with testing frameworks like
JUnit and TestNG, and it includes specialized test utilities like Spring
Boot Test. This module provides annotations and utilities that simplify the
setup and execution of tests, such as @SpringBootTest, which loads the
complete application context for integration tests, and @WebMvcTest,
which focuses on testing the web layer.
Application Metrics and Health Checks
Monitoring application performance and health is vital in production
environments. Spring Boot Actuator provides endpoints for gathering
various metrics and health information about your application. Metrics
include data on memory usage, CPU usage, HTTP request metrics, and
more. Health checks provide information about the status of various
components, such as databases, message brokers, and external services.
This information helps you ensure that your application is running
smoothly and efficiently.
Security Integration
Spring Boot seamlessly integrates with Spring Security, providing a robust
and flexible security framework for your applications. With minimal
configuration, you can secure your applications using various
authentication and authorization mechanisms, such as form-based login,
OAuth2, and JWT. Spring Boot also supports method-level security,
allowing you to enforce security rules on specific methods within your
application. This integration ensures that your applications are secure
without requiring extensive setup.
Integration with Other Spring Projects
Spring Boot integrates effortlessly with other Spring projects, such as
Spring Data, Spring Batch, Spring Integration, and Spring Cloud. This
integration allows you to leverage the full power of the Spring ecosystem,
building comprehensive and scalable solutions. For instance, you can use
Spring Data to simplify database interactions, Spring Batch for batch
processing, Spring Integration for messaging and integration, and Spring
Cloud for building cloud-native microservices. The seamless integration
between these projects ensures that your applications are cohesive and
easy to manage.
Reactive Programming Support
With the introduction of Spring WebFlux, Spring Boot now supports
reactive programming, enabling you to build reactive, non-blocking
applications. Reactive programming is particularly useful for applications
that need to handle a large number of concurrent connections, such as
real-time messaging systems and streaming applications. Spring WebFlux
provides a reactive stack built on Project Reactor, offering a functional
programming model that enhances the scalability and performance of your
applications.
GraalVM Native Image Support
Spring Boot 3.x introduces support for GraalVM native images, allowing
you to compile your Spring Boot applications into native executables.
Native images offer several benefits, including faster startup times and
reduced memory consumption. This feature is particularly useful for
cloud-native applications and serverless environments, where resource
efficiency and quick startup are critical. Spring Boot's integration with
GraalVM ensures that your applications can take advantage of these
benefits with minimal configuration changes.
Spring Boot's such exemplary set of features makes it a reliable platform
for developing modern Java applications, with a strong emphasis on
convention over configuration, coupled with its production-ready
capabilities. Using these features, you can stay focussed on writing
business logic, while Spring Boot totally handles the underlying
complexities of application development.
Setting up Development Environment
To start developing with Spring Boot, you'll need to set up your
development environment. This involves installing necessary software,
configuring your Integrated Development Environment (IDE), and
creating a basic project structure.
Installing JDK
Spring Boot requires the JDK to compile and run applications. Spring
Boot 3.x supports JDK 17 or higher. You can download the latest version
of the JDK from the official Oracle website or use an open-source
alternative like OpenJDK. Once downloaded, follow the installation
instructions specific for Windows:
● Run the JDK installer and follow the prompts to complete the
installation.
Set the JAVA_HOME environment variable to point to the JDK
installation directory. This can be done through the System Properties >
Environment Variables menu.
Add the JDK's bin directory to the PATH environment variable to ensure
Java commands are accessible from the command line.
Installing IDE
An IDE is essential for efficient coding and project management. IntelliJ
IDEA and Eclipse are popular choices for Spring Boot development due to
their robust support for Java and Spring projects.
To install IntelliJ IDEA,
Download and install IntelliJ IDEA from the JetBrains website and
remember the Community Edition is freely available to download and
considered suitable too for most development tasks.
Once installed, open IntelliJ IDEA and configure it for Java development
by selecting the appropriate JDK.
Installing Apache Maven
Apache Maven is a powerful build automation tool used for managing
project dependencies and building Java applications. Spring Boot uses
Maven to manage dependencies, build projects, and run applications. You
can download Maven from the official Apache Maven website.
To install Maven,
● Download the binary zip archive from the Apache Maven website.
● Extract the archive to a suitable location on your system.
Add the bin directory of the extracted Maven folder to the PATH
environment variable.
Installing Spring Boot CLI
The Spring Boot Command Line Interface (CLI) is a useful tool for
quickly developing Spring applications using Groovy scripts. It simplifies
the process of creating and running Spring Boot applications without
requiring a full project setup.
To install Spring Boot CLI,
● Download the Spring Boot CLI distribution zip file from the official
Spring website.
● Extract the zip file to a directory of your choice.
● Add the bin directory of the extracted folder to the PATH
environment variable.
● Verify the installation by opening a command prompt and typing
spring
Creating Spring Boot Project
Spring Initializr is a web-based tool that helps you generate a Spring Boot
project with a pre-configured structure and dependencies. You can access
Spring Initializr
To use Spring Initializr,
● Open the Spring Initializr website.
● Fill out the project metadata fields, such as Group, Artifact, and
Name.
Select the desired dependencies for your project, such as Spring Web,
Spring Data JPA, or Spring Security.
● Choose the project type (Maven Project) and packaging type (Jar).
● Select the appropriate Java version (e.g., 17) and Spring Boot
version (e.g., 3.x).
● Click "Generate" to download the project as a zip file.
● Extract the zip file and open the project in your IDE.
Configuring IDE
After creating your Spring Boot project, you need to configure your IDE
to enhance your development experience.
In IntelliJ IDEA,
Open the project by selecting File > Open and navigating to the extracted
project directory.
IntelliJ IDEA will automatically detect the project structure and import it
as a Maven project.
Ensure the correct JDK is configured for the project by selecting File >
Project Structure > Project and setting the Project SDK.
Install the Spring Boot plugin (if not already installed) to enable additional
features like Spring Boot-specific code assistance and configuration.
Running first Spring Boot App
With your development environment set up, you can now run your first
Spring Boot application. Spring Boot applications can be started directly
from your IDE or the command line.
From IntelliJ IDEA,
Locate the main application class, which is annotated with This class
typically contains a main method that starts the application.
● Right-click the main application class and select Run.
From the Command Line,
● Open a command prompt and navigate to the project directory.
● Run the command mvn spring-boot:run to start the application.
Exploring Project Structure
A typical Spring Boot project has a well-defined structure that includes
several important directories and files:
src/main/java: Contains the application's main source code. This is where
you will write your Java classes and Spring components.
● src/main/resources: Contains application resources like
configuration files, static assets, and templates.
● src/test/java: Contains test classes and test resources.
● pom.xml: The Maven build file that specifies project dependencies
and build configuration.
Adding Dependencies
Spring Boot uses Maven to manage dependencies. To add a new
dependency, you simply update the pom.xml file with the desired
dependency. For example, to add Spring Web dependency, include the
following in the section:
org.springframework.boot
spring-boot-starter-web
After updating the pom.xml file, your IDE will automatically download
and resolve the new dependencies.
Configuring Application Properties
Spring Boot applications use a configuration file to manage application
settings. By default, this file is named application.properties and is located
in the src/main/resources directory. You can use this file to define various
properties such as server port, database connection details, and logging
settings.
For example, to change the default server port, add the following line to
the application.properties file:
server.port=8081
Spring Boot DevTools
Spring Boot DevTools is a useful development-time feature that enhances
the developer experience by providing tools like automatic restarts and
live reloads. To use DevTools, add the following dependency to your
pom.xml file:
org.springframework.boot
spring-boot-devtools
true
DevTools will automatically restart your application whenever you make
changes to the classpath, reducing the time spent on manual restarts.
Spring Boot CLI
Spring Boot CLI is a command-line tool that allows you to run Spring
Boot applications using Groovy scripts. This tool is particularly useful for
prototyping and testing small applications, and to create and run a Spring
Boot application with the CLI, you must follow these steps:
● Create a new Groovy file with the .groovy extension.
● Write a simple Spring Boot application in Groovy. For example:
@RestController
class HelloController {
@RequestMapping("/")
String hello() {
"Hello, GitforGits Publishing!"
}
}
Save the file and run it using the Spring Boot CLI by executing the
command spring run .groovy in the terminal.
This will start the Spring Boot application, and you can access it by
navigating to http://localhost:8080 in your web browser. So, you are now
ready to start building Spring Boot applications.
Creating First Spring Boot Application
This section will teach and lead you through the steps of building a simple
RESTful web service using Spring Boot, along with a hands-on
introduction to the framework's capabilities.
Setting up the Project
Start by creating a new Spring Boot project using Spring Initializr, as
outlined previously. For this example, select the following dependencies:
● Spring Web
● Spring Boot DevTools
Fill out the project metadata (Group, Artifact, Name, etc.) and download
the generated project as we learned in the previous section. Extract the
project and open it in your chosen IDE.
The generated Spring Boot project has a well-defined structure:
● src/main/java: Contains the main application code.
● src/main/resources: Holds application configuration files and static
resources.
● src/test/java: Contains test classes.
Random documents with unrelated
content Scribd suggests to you:
LEWIS H. HUBBARD.
Lewis H. Hubbard, farmer and stockman, of Kapioma township,
Atchison county, was born March 13, 1872, in Cass County, Missouri.
He is a son of Simeon and Mary Ann (Pence) Hubbard, who were the
parents of the following children: William, Kapioma township,
Atchison county, Kansas; Lillie O’Conner, widow, Muscotah, Kan.;
Cora Routh, Kapioma township; Lewis, subject of this sketch, and
two children who died in infancy. The father of Lewis Hubbard was
born March 10, 1840, in Indiana, and grew up as a farmer, following
that occupation after coming to Kansas in 1874. He settled near
Muscotah and rented land for a period of four years and during that
time he saved his money carefully. When he came to Kansas he was
without funds, but at the end of four years he had accumulated
enough to enable him to buy a farm. In addition to growing his crops
he fed stock and did a hustling business in that line. He is still living
and resides at Muscotah, Kan. The mother of Lewis Hubbard is also
living. Lewis Hubbard went to school in the Rose Valley district. He
received a common school education and worked with his father on
the latter’s farm until 1909, when he bought a farm of his own and
became his own manager. The place consisted of 160 acres of fine
tillable soil and is located in section 16, southeast quarter of
Muscotah township. Mr. Hubbard has devoted considerable
attention to improving the appearance of his farm and has
constructed a fine seven-room cottage, and has built a large barn to
provide shelter for his stock and hay. He keeps the best Jersey cows
and milks eight to twelve of them for the dairy. Mr. Hubbard is a
stockholder in the farmers’ grain elevator at Muscotah, Kan.
In 1897 Mr. Hubbard married Anna Hinkston, who was born
May 5, 1880, in Doniphan county, Kansas. She is a daughter of Frank
and Dorinda (Tate) Hinkston, who now live in Jackson county,
Kansas. Mr. and Mrs. Hubbard are the parents of two children, as
follows: Ethel, aged sixteen, who attends the Atchison County High
School at Effingham, and Leslie, aged seven, living with his parents.
The daughter is also studying music, and her father hopes to give her
a thorough education in that subject. Mr. Hubbard is a Democrat of
an independent stamp. He is a member of the Adventist church and
is a deacon in that denomination. If there is one thing that Mr.
Hubbard takes pride in more than another it is in his children’s
education. He realizes the value of an education and desires that his
children have every advantage of education that he can give them.
ARTHUR S. SCHURMAN.
Atchison county is principally an agricultural community, and
not unlike most sections of the great Middle West, the general wealth
and standing of the community is commensurate with the thrift,
enterprise and industry of the individual farmers. He whose name
introduces this sketch is a representative of that type of men whose
efforts have placed Atchison county in the foremost rank of the 110
political sub-divisions of the great state of Kansas.
Arthur S. Schurman is one of the substantial and enterprising
agriculturists in Benton township, and has been a resident of the
township for the past thirty years. He is the owner of 202 acres of
well improved land, which is noted for its excellent yields of grain.
For the past ten years Mr. Schurman has been one of the most
successful wheat growers in Atchison county, or even in the State. He
has produced the great yield of 2,330 bushels of wheat on a tract of
eighty acres. A handsome farm residence, tastefully painted a clean
white, presents an attractive appearance on a rise of land fronting
the highway, which passes east and west in front of his land. This
fine home was built by Mr. Schurman in 1911, and comprises eleven
rooms in all, with a heating and water pressure system, which
completely modernizes the home. The residence is nicely situated in
the midst of a fine grove, which affords a generous shade in summer.
Mr. Schurman carries on diversified farming and raises a
considerable amount of live stock.
Arthur S. Schurman was born January 11, 1864, in Prince
Edward Island, Dominion of Canada, and is a son of Caleb
Schurman, who was born December 8, 1829, on Prince Edward
Island, a son of English parents, who left their native land and settled
on the island many years ago. The great-grandfather of Arthur
Schurman was a German by birth, who established a home in
England. The mother of Arthur S. was Sarah Creswell before her
marriage. She was born May 15, 1835, and died on the home place in
Benton township, November 15, 1889. When but a child she went
from England to Prince Edward Island with her parents. The
Schurman family lived on their native island until 1876, and then
immigrated to the United States, going first to Des Moines, Iowa, in
search of a suitable location. After a residence of eight months in Des
Moines, the family came to Atchison, Kan., where Arthur Schurman
was employed in a harness shop for three years, and also drove a coal
wagon for a retail coal dealer for a time. Caleb Schurman rented a
farm south of Atchison, and later bought the farm now owned by his
son, Arthur. Four children were born to Caleb and Sarah Schurman,
namely: Mrs. J. B. O’Connell, Denver, Colo.; Frederick Robert, a
resident of Effingham, Kan.; Percy Ernest, who died in September,
1896, and Arthur S., the oldest of the family.
Arthur Schurman was twelve years of age when the family came
to the United States, and received a portion of his schooling in his
native land. He remained with his father, and assisted him in
developing his Atchison county farm, purchasing the land from his
father when he came to man’s estate. Caleb Schurman makes his
home with his son, Arthur S., who married in August of 1890, to
Emma Pruitt, of Atchison, Kan., a daughter of James Pruitt. This
marriage has been blessed with the following children: Sadie Mary,
born October 5, 1892, the wife of Fred Dooley, of Lancaster
township; Martha, born April 3, 1893: George Herbert, born
September 21, 1895; Arthur Ernest, born June 3, 1899, and died
October 19, 1900: Ralph, born March 25, 1902.
Mr. Schurman is a Republican, but has never found time to take
an active part in political affairs. He was reared in the Episcopalian
faith. but the members of his family attend the Christian church at
Effingham. He is a member of the Masonic lodge and the Central
Protective Association.
C. A. LILLY, M. D.
C. A. Lilly, M. D., a well known member of the medical
profession of Atchison county, is a native of the Buckeye State. He
was born at Mansfield, Ohio, and is a son of S. and Clara (Beard)
Lilly. The father was a lumberman. Dr. Lilly was reared and educated
in Mansfield, Ohio, and Chicago, Ill., and after obtaining a good
academic and classical education, he entered the Chicago Medical
College in 1897 and was graduated in the class of 1901 with the
degree of Doctor of Medicine. He then came to Kansas and engaged
in the practice of his profession at Seneca. After remaining there
about one year and a half he returned to Chicago and took a post-
graduate course in Rush Medical College, and did considerable
hospital work. In 1904 he located in Atchison, where he has since
been successfully engaged in the practice of medicine and has one of
the extensive practices of Atchison county. He has been division
surgeon for the Missouri Pacific railroad since 1911.
Dr. Lilly was united in marriage in 1902 to Miss Isabel Smith, of
Hiawatha, Kan. Dr. Lilly is a member of the Northeastern Kansas
and the Missouri Valley Medical associations and also belongs to the
County, State and American Medical association.
FRANK J. WATOWA.
Frank T. Watowa, a successful farmer of Shannon township,
Atchison county, was born in Jefferson county, Wisconsin, October
3, 1854, and is a son of Joseph and Catherine Watowa, natives of
Austria, who emigrated from their native land to Wisconsin where
they resided until 1860, when they came to Missouri, locating in
Buchanan county. About 1870 the family came to Atchison and
located on a farm in Shannon township where his son, Joseph H.
Watowa, now resides. The father died in 1895. Frank J. Watowa is
one of a family of seven children, born to Joseph and Catherine
Watowa, as follows: Mary, Henry, Joseph H., Mollie, Earnest,
Paullina and Frank.
Frank J. Watowa was married in 1879 to Miss Anna Falk, who
died in 1885, leaving three children, as follows: Mary, the wife of
Antone Lutz, of Lancaster township; Josephine resides in Colorado
Springs, Colo., and Anna, deceased. On June 24, 1892, Mr. Watowa
was united in marriage to Amanda Smith, and four children have
been born to this union, as follows: Sarah, Frances, Frank and
Lawrence.
Mr. Watowa is one of the extensive farmers of Atchison county.
He has 280 acres of land, nicely located and very productive. In 1895
he built a handsome stone residence, which is one of the finest farm
homes to be found in the county. Politically he is a Democrat, and he
and his family are members of the Catholic church. He is a
progressive and public spirited citizen and one of the substantial
men of Atchison county.
LEWIS BRADLEY.
Lewis Bradley, farmer and stockman, of Kapioma township,
Atchison county, was born February 24, 1857, in Henderson county,
Illinois, and is a son of Hamilton J. and Sarah E. (Pence) Bradley.
The father was born in Steuben county, New York, October 27, 1834.
He followed the stonemason’s trade. Coming to Atchison county,
Kansas, several years later, in 1880, bought the farm of 160 acres
which his son now owns. He came to Kansas with very little capital,
but was able to save enough money to buy 160 acres in Canadian
county, Oklahoma. His death occurred May 24, 1914. The mother,
who died March 8, 1908, was born in Lycoming county,
Pennsylvania, May 14, 1837. Lewis Bradley, the subject of this sketch,
spent the first few years of his life in Illinois, Missouri and Iowa, and
then was brought to Kansas by his parents in 1874. He farmed with
his father until 1898, when he bought the home farm and built a fine
nine-room house on the place, a two-story dwelling. In 1913 he
erected a large barn, 48×60 feet, and keeps the best graded stock.
Mr. Bradley was married September 5, 1881, to Minnie Streeter, who
was born in Boone county, Illinois, October 28, 1865. She is a
daughter of Rev. William H. and Hanna (Vandicar) Streeter, both
natives of Watertown, N. Y. Mr. Streeter came to Kansas in 1870. He
was a Methodist minister and established churches all over Kansas.
He was born September 16, 1825, and died February 28, 1911.
Hanna, his wife, was born May 16, 1826, and died July 29, 1879. Mr.
and Mrs. Bradley have four children as follows: Maud married Albert
Williams, railroad contractor, Muscotah, Kan., who is a graduate of
the county high school and taught for fourteen years; Bessie,
deceased; Henry, living at home, graduate of business college of
Kansas City, Mo.; Leslie married Miss Mabel Swisher, and has three
children, Elberta, Clarence and Bessie. Mr. Bradley is a Republican,
and belongs to the Modem Woodmen of America and to the Mystic
Workers of the World. He and his wife were charter members of the
Advent Christian church at Muscotah. Mr. Bradley is the oldest living
of a family of eleven children; the others living are: Lavelle Green,
Levi, Ellen Sheets, Elmer, May Sommers, and Mary Raasch.
ALFRED J. HAMON.
Alfred J. Hamon, farmer, stockman and builder, is one of those
self-made men whose careers demonstrate to our growing youths the
possibilities of industry and good management. Born with no
unusual gifts and of parents who were only in moderate
circumstances, he has, by his own efforts, built up a worthy name for
himself in the community in which he lives. Mr. Hamon was born in
Kapioma township, Atchison county, Kansas, July 10, 1863. He was
one of five children born to William and Leanah (Brutton) Hamon.
Emma Royer, the oldest child, is dead; Alfred, the subject of this
sketch, is the second in order of birth. The others are: Nancy
Heimbach, Effingham, Kan.; John, Jefferson county, Kansas:
Samuel, Kapioma township. The father was a Kentuckian, born in
1835, and during part of his young manhood he farmed in his native
State. Coming to Kansas in the early days, he homesteaded 160 acres
in Kapioma township, Atchison county. This land was covered with
timber, and rather than attempt to clear it, he traded it for prairie
land which composed the farm on which he lived until his death in
1873, and his widow is living on the farm in Kapioma township, at
the age of seventy-six years.
Alfred Hamon grew up on the farm and attended school at Cole
Creek district a few months each year, and at the age of twenty-one
he started out for himself, renting a farm. Three years later he
bought the place and owned it three years. He then worked at the
carpenters’ trade in Atchison for three years and during this time he
worked in many places around Atchison and helped erect some of
the more important buildings, which were constructed during that
time. Another two years was spent on the farm in Kapioma township,
and Mr. Hamon returned again to Atchison to work at his trade.
Carpenter work appealed to him more than farming and he spent
twenty-three years handling the plane and the saw. For thirteen
years of this time he did contracting and supervised the erection of
many buildings. Meanwhile he accumulated considerable property in
Atchison, and in 1906, the exacting work of carpentry became
tedious to Mr. Hamon, and he returned to farming, after twenty-
three years in Atchison. He had eighty acres of well improved land in
Kapioma township, section 23. He built a fine house and barn,
utilizing his experience in construction work to put up the best
buildings that the money would afford. His improvements cost
$4,000. Mr. Hamon was a real farmer as well as a carpenter. In 1911
he won first prize with an exhibit of yellow corn at the Muscotah fair.
In 1884 he married Emma Tull, who was born in October, 1863,
in Kapioma township, Atchison county. She is a daughter of John
and Hanna H. (Rust) Tull, Virginians, who settled in Atchison county
at an early date. Mr. and Mrs. Hamon have five children as follows:
Effie, deceased; Edna Piper, California: Susan Clark, of Kansas City,
Kan.; Roy and Ruth, living at home. Mr. Hamon is a member of the
Christian church. He is a Republican and has been a member of the
school board in his township.
JOHN GRIFFIN.
John Griffin, farmer and stockman, of Kapioma township,
Atchison county, Kansas, is a native of Kansas, having been born on
the farm where he now lives March 25, 1882. His parents, Lawrence
and Ellen Griffin, lived on the farm in Kapioma township. John
Griffin was brought up on the farm and when a small boy divided his
time between chores and school at district No. 60, Kapioma
township, and later attended St. Benedict’s College at Atchison, Kan.
Considering the time spent in school, John started out in life
remarkably early, making his first venture at the age of eighteen,
renting a farm from his father. He continues to work the farm rented
from his mother at the present time.
On October 15, 1912, John Griffin married Christena Hanson.
Mrs. Griffin was born November 12, 1885, in Doniphan county,
Kansas. Her parents, Nels and Christena (Henderson) Hanson, were
natives of Denmark, who came to Doniphan county, Kansas, about
1870, where they engaged in farming. The father died in 1892, at the
age of fifty. The mother is living with her son, Crist Hanson, in
Kapioma township, Atchison county, and is sixty-three years old.
Mrs. Griffin attended the district schools in Doniphan county,
Kansas. Mr. Griffin is a member of the Catholic church, and
politically, has affiliated himself with the Democratic party. Mr.
Griffin is a conscientious citizen and a hard worker.
DAVID BEYER.
David Beyer, farmer and stockman of Kapioma township,
Atchison county, was born August 29, 1866, in Clearfield county,
Pennsylvania. He was the fourth child born to Asa and Susan Beyer,
who were the parents of eleven children, ten of whom are living, as
follows: Mary Lewton, Benton township; Samuel, Kapioma
township; Christena High, Texas; David, the subject of this sketch;
Jane, living on the home place; Clarissa, deceased; Martha
Schiffbauer, Sumner county, Kansas; John, banker, Arrington, Kan.;
Albert, Caldwell, Kan.; Luctria Dodson, Kapioma township; Mabel B.
Royer, Kapioma township, Atchison county.
Asa Beyer, the father of David, was a carpenter by trade; he was
born in Pennsylvania in 1835, and after following his trade in his
young manhood, came to Kansas in 1868, and bought an eighty-acre
farm in Kapioma township, Atchison county. He gradually increased
his holdings to 340 acres, which he owned at the time of his death in
1898. The mother of David Beyer is a Pennsylvanian also and is now
living on the home place in Kapioma township. David attended
district school in Pennsylvania and started out to shift for himself at
the age of twenty-one. When he came to Kansas and bought the
eighty-acre farm, there were no improvements on the place. In 1892,
he built a substantial house and in 1907, he built a fine two-story,
ten-room house, and modern in every respect. In 1911 he built a large
barn, 36×52 feet. Mr. Beyer now owns 258 acres of land which were
formerly owned by his father.
In 1897 Mr. Beyer married Anna Cawley, who was born in
Atchison, Kan., June 30, 1862. She is a daughter of John and
Margaret (Welch) Cawley, both natives of Ireland. They were early
settlers in Atchison, having come here in 1858. Later they came to
Kapioma township. Mr. and Mrs. Beyer are the parents of three
children, as follows: Asa, Marie and Margaret, all living at home. Mr.
Beyer attends church regularly though he is not a member of any
denomination. He belongs to the Independent Order of Odd Fellows.
He is a Republican, and has served as township treasurer.
GEORGE W. GIBSON.
George W. Gibson, farmer, of Kapioma township, Atchison
county, was born May 16, 1855, in Clearfield county, Pennsylvania.
He is a son of Jacob and Leah (High) Gibson, who were the parents
of eleven children, eight of whom are living. The father was born in
Maryland, and the mother in Pennsylvania. They came to Kansas in
1871 and settled in Kapioma township, Atchison county. Here the
father bought 160 acres of land and erected a small house on it. In
the early days when he was just getting on his feet financially, he had
to economize at every point and to begin with built a straw barn.
Later, he improved the farm until it was a modernly equipped place.
Mr. Gibson lived on this farm until his death in 1900, at the age of
seventy-six years. The mother died the following year at the age of
seventy.
George Gibson, the subject of this sketch, attended the district
schools in Pennsylvania, Illinois and Kansas. At the age of twenty-
one years he started out to farm for himself. He rented land for a
year when he engaged in teaching at Larkinburg, Jackson county,
Kansas. Later he taught at Arrington, Atchison county, and,
altogether, Mr. Gibson taught school for three years. He then bought
eighty acres of unimproved prairie land, which he broke and
improved. Mr. Gibson used good judgment in his investments and
was successful in every venture. He now owns 840 acres of land in
Kansas and Texas. The farm on which he lives, is modern in every
respect and he has built an especially fine barn on it.
In 1880 Mr. Gibson was married to Elizabeth Miller, who was
born May 9, 1860, in Atchison county, Kansas. She is a daughter of
James and Eliza (Russell) Miller. The father was born in Clay county,
Missouri, August 3, 1831, and was a son of Moses Miller, a
Kentuckian. James Miller spent his early days in the West, working
for the Government. Later he became a large cattle breeder in
Atchison county and came to be known as the “Cattle King” because
of his extensive activities in the cattle business. He died at Mscotah,
Kan., September 12, 1913, and the mother of Mrs. Gibson died in
1879. She was a native of Iowa. Mr. and Mrs. Gibson have nine
children: Daisy M. Anderson, of Muskogee, Okla., who was
graduated from the Kansas Western Business College, and later
taught school in Kansas and Colorado; Dr. Frank C. Gibson, a
graduate of the Physicians’ and Surgeons’ School of Chicago, now
practicing in Bovill, Idaho, where he is surgeon for a railroad
company and has charge of a hospital; Charles R., farmer, Kapioma
township, Atchison county; Lucy M. Irwin, Dallas, Texas; Harry L.,
farmer on the home place; Ruth, attending Kansas University,
Lawrence; George W., Jr., John and William, living at home. Mr.
Gibson is an independent progressive Republican. He has held the
township offices of clerk, treasurer and trustee.
FRANK J. HUNN.
Frank J. Hunn has combined the activities of banker, public
citizen, farmer, and stockman, with the refinements of education,
and lives today as an example of an all around man of influence. Mr.
Hunn is a native Kansan, having been born in Garfield township,
Jackson county, Kansas, March 2, 1860. He comes of parentage of
the sturdy pioneer type, brave, but God-fearing. The father, Joseph
Hunn, was born in 1815, of English descent, being a son of a London
minister. He was a native of Connecticut and lived there until he was
of middle age. Coming to Kansas in 1857, he preĂŤmpted a claim one
mile east and a mile north of Arrington, Atchison county, Kansas.
Here he constructed a cabin home and lived in the rough life of the
frontier. But this was not new to Joseph Hunn, for he had been one
of that vast army of adventurers who crossed the western plains in
“forty-nine,” to seek gold in California. For four years he had
undergone the hardships of prospecting and the rigors of Kansas
winters weighed less heavily on him than they did on many settlers.
After two years on the Atchison county place, he sold out and
removed to Larkin, Jackson county, Kansas, living there until 1865,
when he took possession of the farm now owned by his son, Frank J.
The father died two years later, leaving his wife, Elizabeth, with two
children, Frank, and a daughter, Bessie, since married to Mr.
Kathrens, a merchant, of Arrington, Kan.
Elizabeth Hunn, whose maiden name was Redman, is of English
and German descent, coming from a line of religious ancestors, all of
her family being of a devout nature. She was born in 1825, and died
December 16, 1912, having lived a long and useful career. After the
death of her husband she was occupied with the management of the
farm, but in her younger days she led a life full of service to others.
She worked as a nurse among the sick in the early times, when
medical attention was expensive and hard to get, and her efforts
saved untold suffering and expense to many settlers. She was a
school teacher in Iowa for some time, and always took a great deal of
interest in the affairs of the church and Sunday school. Until two
years before her death Mrs. Hunn taught a Sunday school class at the
Arrington Methodist church, and, although she was eighty-five years
old, her age never kept her away from her class. She was always on
time and in her place and constantly set a good example for younger
persons.
With such persons for parents it is to be expected that Frank
Hunn would develop into a good citizen. With the high ideals
instilled in his young mind, Frank when a boy was encouraged to
study hard at school, and when he finished the graded courses at the
Arrington school, he went to Campbell College, at Holton, Kan. Here
he spent a short time, and at the age of twenty-two years began
farming for himself. In 1893 he bought his father’s old place and has
since increased it to 250 acres. But his activities do not stop at the
limits of his farm. He has broken the isolation of the farmer and has
taken an active part in affairs for the good of the community. He is
recognized as a conservative, shrewd business man, and now is
president of the Arrington Bank, a position of trust and
responsibility. The fact that his fellow-shareholders in the enterprise
were willing to place such an honor upon him is proof of his
character and achievements. He takes a great deal of interest in
Shorthorn cattle and is recognized as a breeder of fine strains. He
also keeps graded horses and hogs.
In 1894 Mr. Hunn was married to Susie Gibson. (A sketch of her
brother, George W. Gibson, appears elsewhere in this volume.) Mrs.
Hunn was born in January, 1860, in Pennsylvania, and was a teacher
in the district school of Kapioma township before her marriage. Mr.
and Mrs. Hunn are the parents of three children, the oldest of whom
is Frank, a graduate of Effingham high school, now living at home;
Edna and Mildred, the other two children, also live with their
parents. Mr. Hunn attends the Methodist church, although he is not
a member. He is an independent voter, preferring to cast his ballot
for the man whom he thinks will make the best official regardless of
party affiliations. He has held the office of township clerk, township
trustee, and township treasurer, which positions he filled in a
praiseworthy manner. At present Mr. Hunn is a member of the
school board of Kapioma township.
AUGUST J. WOLF.
August J. Wolf, farmer and stockman, of Atchison county, was
born October 17, 1862, in Doniphan county, Kansas. He is a son of
Gottlieb and Joehanna Wolf, who were the parents of fourteen
children, seven of whom are living. The parents of August Wolf were
born in Germany and both grew up there and were married in the
capital city. In 1860 they left the Fatherland with their five children
and came to Doniphan county, Kansas, where they engaged in
farming. In 1880, they came to Atchison county, Kansas, and bought
the farm of 240 acres which is now owned by their son, August, the
subject of this sketch. Five years later they moved to Atchison, Kan.,
where the father died in 1904, at the age of eighty-five years. The
mother died in 1914, at the age of eighty-one. August Wolf grew up
on his father’s farm and at the age of twenty-seven started out to
shift for himself. He rented his father’s farm, and also helped his
father in the threshing business. While feeding a thresher he had his
right hand torn off. This, of course, disabled him greatly, but he kept
up courage and after his injury had healed engaged in threshing
again. In 1902 he bought his father’s farm, and kept up both farming
and threshing until 1905, when he gave all of his attention to
farming. Just after this a storm destroyed many of the buildings on
his place and he rebuilt them better than they were before and made
several additions. He now owns 320 acres of land, seventy of which
he plants in corn each year. In 1910 he retired from active work on
the farm, and his son-in-law, Will Graham, now has actual charge of
the place. Mr. Wolf has been twice married, his first wife being Mary
Walsh, a native of Germany, to whom he was married in 1890. No
children were born to them and the wife died in 1912. Mr. Wolf later
married Dorothea Hoffman, who was born in Atchison county, April
15, 1870, and is the daughter of Frederick and Katharena (Scheu)
Hoffman. Her parents are of German birth, both having left their
native country when quite young. They were married in Illinois and
came to Kansas about 1860, where nine children were born to them.
Three had been born to them while they were living in Illinois. The
father engaged in farming in Center township and worked the place
which Frank Hubbard now farms and was also a blacksmith in
Atchison, Kan., for a few years. He died in July, 1887, at the age of
fifty-six years. No children were born to Mr. and Mrs. Wolf, and the
wife died in July, 1913, at the age of seventy-six years. Mr. Wolf is a
Republican. He is a member of the Fraternal Order of Eagles and
belongs to the Evangelical church. Mr. Wolf has striven under the
greatest difficulties, having lost his right hand when a young man, he
has been immeasurably handicapped through the greater part of his
life. This is especially true in view of the fact that he followed
farming, where, if anywhere, the use of both hands is necessary.
Though it was a great disadvantage that Mr. Wolf was placed under,
he made a success of his career by hard work and good management.
FRANK J. WAGNER.
Frank J. Wagner, farmer and stockman, of Center township,
Atchison county, was born July 16, 1864, in Austria. He is a son of
Frank J. and Louise (Frennar) Wagner, and was one of seven
children, four of whom are living. The parents were born in Austria
and the father remained there until his death in 1870. He was a
farmer and was seventy-eight years old when he died. In 1888 the
mother left Austria and came to Atchison, Kan., where she is now
living. She was married a second time and this husband is also dead.
She will be seventy-six years old in August, 1916. Frank J. Wagner,
the subject of this sketch, was educated in his native land and after
attending the Austrian schools learned the trade of wagon maker.
Until 1884 he worked at this trade in Austria. He then immigrated to
America and came to Atchison, Kan., where he worked for a lumber
company for some time. Three years later he went to work on a farm,
and after five years he returned to Atchison and worked two years.
He then rented land in Shannon township, Atchison county, and in
1905 bought 160 acres in Center township. He bought this place just
in time to have his buildings torn to pieces by the storm of 1905.
Most of the buildings were blown down by the wind and it was
necessary to rebuild practically all of them. In doing this he made
some $5,000 worth of improvements. Mr. Wagner takes a great deal
of interest in the breeding of fine Poland China hogs.
He was married to Amelia Wonder, March 5, 1890. She is a
daughter of Wenzel and Amelia Wonder, and was born in Austria in
August, 1873. She came to America with her mother in 1888, and
later settled in Atchison county. Mr. and Mrs. Wagner are the
parents of the following children: Frank, farming with his father;
Karl, living with his father; Frances, married to M. Mudice; Ada,
deceased: John, Albert and George, living at home. Mr. Wagner is an
independent Democrat in politics. He is a member of the Catholic
church and of the Fraternal Order of Eagles.
WILLIAM WEHKING.
William Wehking, farmer and stockman, of Center township,
Atchison county, was born in Westphalia, Germany, November 26,
1866. He is a son of Christian and Christena (Ruhe) Wehking, who
were the parents of seven children, one of whom is dead. The parents
both died in their native land. William Wehking worked in a flour-
mill in Germany until 1886, when he immigrated to America. He
thought that the West offered the best opportunity to a poor boy, and
came to Kansas, settling in Cummings, Atchison county. He began
working on a farm at thirteen dollars a month. Eight years later he
rented land near Nortonville, Kan. In 1894 he bought eighty acres in
Jefferson county, Kansas, where he farmed eight years. Later, he sold
this place and bought the farm of 150 acres which he now owns. He
erected a fine silo on this place and is especially prepared to raise
fine stock. He has since increased his holdings to 190 acres and has
ventured into the dairy business fine Durham cattle and Poland
China hogs in which he takes great pride. Mr. Wehking is a
stockholder in a mercantile enterprise in Nortonville, Kan.
In 1895 Mr. Wehking married Minnie (Giesking), who was born
in Germany August 31, 1876. When sixteen years old she came to
America and settled at Lancaster, Kan. Mr. and Mrs. Wehking have
eight children: Martha, Edward, Clara, William, Alma, Ernst,
Frederick and Henry, all living at home. Mr. Wehking is an
independent voter and is a member of the Lutheran church. He is a
shrewd business man and has been successful primarily because of
his conservative judgment in handling his business ventures.
WILLIAM HARTMAN.
William Hartman, prosperous farmer, of Mt. Pleasant township,
Atchison county, was born in Platte county, Missouri, in 1851, a son
of Jonathan and Christina (Wolking) Hartman, the latter a native of
Hanover, Germany, and emigrated from her native land with her
parents when ten years of age, locating in Cincinnati, Ohio. Jonathan
Hartman was born in 1821, at Brookville, Franklin county, Indiana,
and was a son of Henry Hartman, who was born in Pennsylvania,
and was among the first settlers of Franklin county, Indiana. In 1842
Henry left Indiana and settled in Platte county, Missouri, and was
among the early pioneers of that county. He died on his farm in
Missouri in 1860. Jonathan, the father of William, was reared to
young manhood in Indiana and was married there. In 1847, he with
his wife and two children followed his father to Platte county,
Missouri, and there followed his trade of millwright in Platte City
until 1849, when he made the overland trip to California with ox
teams, remaining on the coast for two years. He made some money
while in the gold fields and returned home by way of Cape Horn,
paying $500 for his passage. Captain Fulger was in command of the
ship and he lost his vessel on the coast of Central America, the vessel
striking the rocks and breaking in pieces. All aboard were rescued
except the first mate. There were 500 passengers on this vessel who
were compelled to wait on the west coast for five weeks before an
opportunity presented itself to cross the mountains to the eastern
shore. They were eventually taken across the mountains, but several
died from the hardships they endured during the trip. Mr. Hartman
secured passage to New Orleans, and from that city came up the
Mississippi river to St. Louis, arriving there in December of 1850.
From St. Louis the returned argonaut went to his home at Platte City.
Three years later he set out with five wagons in partnership with his
brother-in-law, R. D. Johnson, en route to Salt Lake City, Utah. The
wagons were heavily loaded with provisions, drygoods and liquor.
When the expedition arrived at the south fork of Green river they left
three wagonloads at that point and pressed onward to their
destination to the north fork of the river. They traded with the
Indians and Mormons and made considerable money. Prices were
fabulous in the far West in those days, flour bringing $100 per
hundred weight; common work shirts sold for five dollars each,
whiskey brought five dollars per pint, and the prices of other
commodities were in proportion. Returning home from this trip Mr.
Hartman lived in Platte City until 1854, and then came to Kansas
with the first steam sawmill ever erected in Atchison county, and one
of the first to be placed in operation in Kansas. He established his
mill at old Port William and operated it successfully until 1857. He
then came to Mt. Pleasant township and preĂŤmpted a claim now
known as the Howe farm which he sold for fifty dollars. He traded
his sawmill for a farm near Parnell, Kan., now owned by Robert Volk.
Jonathan was personally acquainted with Pardee Butler, and met
and conversed with Butler after he had been set adrift on a raft on
the Missouri river by pro-slavery men. He took Butler to his home
and gave him his supper. He hid the refugee at the home of a
neighbor until the next day and then accompanied him to Weston,
from which point Mr. Butler made his way to his old home in Ohio,
where he remained in safety for nine months before he returned to
Kansas. Jonathan Hartman was a Free State man and a Republican
in politics, who took a prominent and influential part in the affairs of
his locality. He was appointed guardian for the war widows and was
selected by the Civil war veterans of the county to distribute the
money apportioned to the war widows. On account of defective
hearing, contracted as a result of an attack of mountain fever, he was
not eligible for service in the Union army, but lent his moral support
to the Union. He died on the farm January 24, 1897. He was the
father of nine children, three of whom are living, as follows: R. D.
Hartman, born in Missouri in 1847; William Hartman, the subject of
this review; and Henry Hartman, born in Indiana; Frederick
Hartman, former sheriff of the county; Elijah Hartman, born in
Atchison county, Kansas, in 1856, and died in 1890; Alice, wife of E.
N. Eshom, of Atchison county.
William Hartman grew up on his father’s farm and was educated
in the district school of his neighborhood. He was married in 1883 to
Florence A. Good, a daughter of Daniel Good, an early settler of
Atchison county, and originally from New York State. Mr. Hartman
is the owner of 140 acres of very fine and productive land near old
Parnell. The children of William and Florence Hartman are as
follows: Morris, Jonathan H., Nelson, Mariwillie, wife of H. W.
Gilbert, of Horton, Kan.; and Flossie, wife of J. C. Cartmille, of
Atchison county; Warren, the youngest of the family, was born
November 11, 1901.
Mr. Hartman is a stanch Republican in politics, is a member of
the Christian church, and is affiliated with the Independent Order of
Odd Fellows.
ROYAL BALDWIN.
Near the old village of Kennekuk, in the northeast corner of
Grasshopper township, Atchison county, Kansas, stands the old
home of Maj. Royal Baldwin, Indian agent. This home was built sixty
years ago by Major Baldwin and is at present the home of Mrs.
Jennie L. Dollinds, the last of the race of Baldwins in Atchison
county. This narrative, therefore, will deal principally with the life
career of Royal Baldwin, United States Indian agent, who was widely
known in all of northeast Kansas as Major Baldwin.
Royal Baldwin was born in Litchfield, Conn., June 22, 1817, and
was a descendant of ancestors who came over from England in the
Mayflower. Three brothers, Ira, Julius, and Thomas, landed at
Plymouth Rock with the party of Pilgrims who sought homes in the
forbidding wilderness of New England in 1620. Julius Baldwin was
the founder of the family of which Royal Baldwin descended, and he
finally settled in Connecticut, where Royal was born and reared to
young manhood. Royal Baldwin received a good education in the
public schools and academy of his neighborhood in Connecticut, and
when fifteen years of age he began teaching school. Later, the spirit
of adventure moved him and he went to Ohio, where he became a
boatman on the Muskingum river. While living in Ohio he married
Miss Ann Campbell, who was born February 15, 1820, in Belmont
county, Ohio, and died July 16, 1894. She was a daughter of Joseph
Campbell, of Scotch parents, and who married a lady of Welsh
parentage. After his marriage Royal Baldwin settled in Meigs county,
Ohio, where their three children were born. In 1856 Mr. Baldwin was
appointed Indian agent by the United States Government and sent to
northeast Kansas to take charge of the moving of the four tribes, the
Kickapoos, Sacs, Foxes and Pottawatomies to their Kansas
reservations. When he received his appointment he removed with his
family overland to St. Joseph, Mo., and immediately began his duties
of settling the Indians on their reservations. He remained as Indian
agent for twelve years and then resigned his position on account of
poor health, but was again appointed and held the office for three
years, after which he resigned, but was re-appointed by the
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.
More than just a book-buying platform, we strive to be a bridge
connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.
Join us on a journey of knowledge exploration, passion nurturing, and
personal growth every day!
ebookbell.com

Spring Boot 30 Crash Course Mastering Spring Boot From Application Development To Advanced Security Data Access Integration And Deployment

  • 1.
    Spring Boot 30Crash Course Mastering Spring Boot From Application Development To Advanced Security Data Access Integration And Deployment download https://ebookbell.com/product/spring-boot-30-crash-course- mastering-spring-boot-from-application-development-to-advanced- security-data-access-integration-and-deployment-58709300 Explore and download more ebooks at ebookbell.com
  • 2.
    Here are somerecommended products that we believe you will be interested in. You can click the link to download. Spring Boot 30 Cookbook Proven Recipes For Building Modern And Robust Java Web Applications With Spring Boot 1st Edition Felip Miguel Puig https://ebookbell.com/product/spring-boot-30-cookbook-proven-recipes- for-building-modern-and-robust-java-web-applications-with-spring- boot-1st-edition-felip-miguel-puig-58534736 Spring Boot 30 Cookbook Proven Recipes For Building Modern And Robust Java Web Applications With Spring Boot Felip Miguel Puig https://ebookbell.com/product/spring-boot-30-cookbook-proven-recipes- for-building-modern-and-robust-java-web-applications-with-spring-boot- felip-miguel-puig-58439478 Spring Boot 30 Cookbook Proven Recipes For Building Modern And Robust Java Web Applications With Spring Boot Felip Miguel Puig https://ebookbell.com/product/spring-boot-30-cookbook-proven-recipes- for-building-modern-and-robust-java-web-applications-with-spring-boot- felip-miguel-puig-58466608 Spring Boot 30 Cookbook Felip Miguel Puig https://ebookbell.com/product/spring-boot-30-cookbook-felip-miguel- puig-200655718
  • 3.
    Learning Spring Boot30 Third Edition Greg L Turnquist https://ebookbell.com/product/learning-spring-boot-30-third-edition- greg-l-turnquist-47823514 Mastering Spring Boot 30 A Comprehensive Guide To Building Scalable And Efficient Backend Systems With Java And Spring Ahmet Meric https://ebookbell.com/product/mastering-spring- boot-30-a-comprehensive-guide-to-building-scalable-and-efficient- backend-systems-with-java-and-spring-ahmet-meric-200681856 Mastering Spring Boot 30 A Comprehensive Guide To Building Scalable And Efficient Backend Systems With Java And Spring Ahmet Meric https://ebookbell.com/product/mastering-spring- boot-30-a-comprehensive-guide-to-building-scalable-and-efficient- backend-systems-with-java-and-spring-ahmet-meric-58179160 Mastering Spring Boot 30 Ahmet Meric https://ebookbell.com/product/mastering-spring-boot-30-ahmet- meric-146572384 Spring Boot 3 Recipes A Problemsolution Approach For Java Microservices And Cloudnative Applications 2nd Marten Deinum https://ebookbell.com/product/spring-boot-3-recipes-a-problemsolution- approach-for-java-microservices-and-cloudnative-applications-2nd- marten-deinum-56416454
  • 5.
    Spring Boot 3.0Crash Course Mastering Spring Boot, from Application Development to Advanced Security, Data Access, Integration and Deployment Kit Harrington
  • 6.
    Preface This Spring Boot3.0 Crash Course will teach you all you need to know to create powerful Spring applications with the latest version of the framework. You will be able to create any feature that an application may require because this book covers everything from the fundamentals to advanced features. First things first: get your development environment ready and build your very first Spring Boot App. Data access, security, configuration, and testing are some of the more advanced subjects you'll cover as you go along. This crash course will teach you how to create RESTful services, use Spring Data JPA to integrate different types of data, and work with properties and YAML files to oversee configurations. You practice to manage application properties, get into the application of annotations, and master the Spring MVC architecture. It will teach you to manage form submissions, validate user input, and construct dynamic web pages using Thymeleaf templates. The book also covers topics like integrating front- end frameworks, handling errors, and deploying applications to cloud platforms and Kubernetes. Issues with configuring URL authorization, implementing JWT authentication, and integrating with OAuth2 and OpenID Connect are some of the critical problems that are being solved in this book. Methods for troubleshooting auto-configuration issues, managing environment variables in Docker, and making use of performance testing tools such as JMeter are all topics that will be covered. Additionally, the book delves into the topic of how to integrate with Active Directory and LDAP for centralized user management and authentication.
  • 7.
    By the timeyou finish this book, you will know everything there is to know about Spring Boot application development, security, and deployment, so you can confidently take on real-world projects. In this book you will learn how to: Discover the ins and outs of efficiently configuring a Spring Boot 3.0 development environment. Integrate various data sources and construct strong RESTful services with the help of Spring Data JPA. Get to know Spring Boot's properties and YAML files to set up customizable apps. Use Spring Security and JWT tokens to implement secure authorization and authentication. Use Thymeleaf templates to build interactive websites and easily handle form submissions. Use Kubernetes and cloud platforms to effortlessly deploy Spring Boot applications. Make your apps more up-to-date and responsive by incorporating front- end frameworks such as Angular and React. Put thorough error handling strategies into your applications and handle errors gracefully. Use Docker to manage environment variables and JMeter to optimize application performance.
  • 8.
    Prologue Thank you forchoosing our Spring Boot 3.0 Crash Course. Hi, I'm Kit Harrington, and I'm really excited to show you how to use Spring Boot 3.0. Allow me to begin by relating a tale that exemplifies why this book is so important. A fast-growing tech startup had me as their project manager a few years back. The success of the business hinged on creating a safe, scalable, and reliable app that could manage thousands of users with ease. These lofty expectations were squarely on my shoulders as lead developer. The complexity of integrating different technologies, guaranteeing security, and optimizing performance was a challenge for me, even though I have a lot of experience in this area. I started using Spring Boot as my primary tool at that point. An easier way to build apps using the Spring framework was made available by Spring Boot. I was able to focus on creating effective code because it made setting everything up and running much easier. Thanks to Spring Boot's robust capabilities, we were able to build and deploy features at an incredible pace. Mastering Spring Boot, though, necessitated familiarity with its foundational concepts, recommended practices, and more complex features. That experience is the foundation of this book. I hope that by sharing what I've learned and the solutions I've found, you'll be able to build your Spring Boot applications with ease and confidence. In this book, I'll show you how to build an app using Spring Boot from the ground up, including all the necessary features and making sure it's secure, scalable, and fast. You may find at times repetition of steps while demonstrating practical
  • 9.
    examples, so apologyin advance but the intention is to ensure you dont get stuck in the middle of coding the application. In this first step, you will build your first Spring Boot app and configure your development environment. The course will teach you the ins and outs of dependency management, application configuration via properties and YAML files, and more. Annotations, data source integration with Spring Data JPA, and RESTful service construction are some of the more advanced topics that we will cover as we go along. I will demonstrate how to incorporate Spring Security authentication and authorization, two essential components of any application. In this lesson, you will find out how to secure your application from intruders by configuring basic authentication, URL authorization, and JWT authentication. Also covered will be the basics of working with Thymeleaf templates to build dynamic web pages, accept and process form submissions, and check user input. Learn the ins and outs of integrating popular front-end frameworks such as Angular and React to create cutting-edge, mobile- friendly apps. I will show you how to package your app, make Docker images, and deploy them to cloud platforms and Kubernetes—all of which are essential steps in the development process. Managing environment variables and achieving zero downtime during deployments are topics you'll cover in this course. Using JMeter for performance testing, I will demonstrate how to optimize performance, which is essential for deliver ing an excellent user experience. You will gain knowledge on how to locate performance issues and enhance your application to its full potential.
  • 10.
    With the knowledgeand skills, you gain from this book, you will be able to confidently construct applications that are strong, secure, and perform well. So that you can put what you learn into practice right away, I want to equip you with practical knowledge and real-world examples. Come on, let's start making awesome Spring Boot apps! Copyright Š 2024 by GitforGits All rights reserved. This book is protected under copyright laws and no part of it may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage and retrieval system, without the prior written permission of the publisher. Any unauthorized reproduction, distribution, or transmission of this work may result in civil and criminal penalties and will be dealt with in the respective jurisdiction at anywhere in India, in accordance with the applicable copyright laws. Published by: GitforGits Publisher: Sonal Dhandre www.gitforgits.com
  • 11.
    support@gitforgits.com Printed in India FirstPrinting: July 2024 Cover Design by: Kitten Publishing For permission to use material from this book, please contact GitforGits at support@gitforgits.com.
  • 12.
    Content Preface GitforGits Acknowledgement Chapter 1: Upand Running with Spring Boot Chapter Overview What is Spring Boot? Emergence of Spring Boot Relation to Spring Framework Recent Version Applications, Programs, and APIs Key Features of Spring Boot Auto-configuration Spring Boot Starters Embedded Servers Production-Ready Features Externalized Configuration Spring Boot CLI DevTools Spring Initializr Actuator
  • 13.
    Spring Boot DevTools SimplifiedDependency Management Simplified Testing Application Metrics and Health Checks Security Integration Integration with Other Spring Projects Reactive Programming Support GraalVM Native Image Support Setting up Development Environment Installing JDK Installing IDE Installing Apache Maven Installing Spring Boot CLI Creating Spring Boot Project Configuring IDE Running first Spring Boot App Exploring Project Structure Adding Dependencies Configuring Application Properties Spring Boot DevTools Spring Boot CLI Creating First Spring Boot Application Setting up the Project Creating Main Application Class Creating a REST Controller Running the Application Understanding Auto-configuration Adding Dependency Injection
  • 14.
    Exploring Application Properties UnderstandingSpring Boot Dependencies Spring Boot Starters Maven Dependency Management Adding Custom Dependencies Using Spring Boot DevTools Dependency Exclusions Resolving Dependency Conflicts Using Bill of Materials (BOM) Upgrading Dependencies Annotations Overview Core Annotations Stereotype Annotations Configuration and Bean Annotations Dependency Injection Annotations Spring MVC Annotations Data Access Annotations Testing Annotations Actuator Annotations Overview of Spring Boot CLI Installing Spring Boot CLI Creating Simple Web App with CLI Using Spring Boot CLI for Dependency Management Packaging Applications with Spring Boot CLI Spring Boot CLI for Existing Projects Prototyping
  • 15.
    Spring Boot CLIConfiguration Spring Boot CLI with Spring Initializr Spring Boot CLI with Groovy Templates Summary Chapter 2: Building First Spring Boot App Chapter Overview Creating a Basic RESTful Service Main Application Class Creating a REST Controller Running the Application Expanding the REST Controller Handling GET and POST Requests Implementing GET Requests Implementing POST Requests Handling PUT and DELETE Requests Implementing PUT Requests Implementing DELETE Requests Using Path Variables and Request Parameters Using Path Variables Using Request Parameters
  • 16.
    Using Message Converters Built-inMessage Converters Sample Program: Working of Message Converters Spring MVC Architecture Overview Understanding Spring MVC Spring MVC Core Components Sample Program: Inner Workings of MVC Components Error Handling in Spring Boot Built-in Error Handling Customizing Error Responses Handling Validation Errors Summary Chapter 3: Configuration and Properties Chapter Overview Spring Boot Configuration Overview Application Properties YAML for Structured Configuration Profiles for Environment-Specific Configurations Externalizing and Securing Configuration Using Application Properties Basic Configuration Grouping Related Properties
  • 17.
    Configuring Logging Profiles inApplication Properties External Configuration Using Application Properties Configuration with YAML Files Setting up YAML Configuration Advantages of YAML Profiles with YAML Accessing YAML Properties Profiles and Environment Specific Configurations Defining Profiles Activating Profiles Using Profile-Specific Beans Combining Profiles Profile-Specific Configuration Properties Accessing Profile Information Externalizing Configuration Using Environment Variables Centralized Configuration with Spring Cloud Config @Value and @ConfigurationProperties Using @Value Using @ConfigurationProperties Binding Complex Nested Properties Validation with @ConfigurationProperties Type-Safe Configuration Properties Setting up Type-Safe Configuration Properties
  • 18.
    Advanced Type-Safe Configuration ReloadingConfiguration Properties at Runtime Using Spring Cloud Context Using Spring Cloud Bus Handling Configuration Reloads Monitoring Configuration Changes Summary Chapter 4: Spring Boot Packaging and Deployment Chapter Overview Packaging a Spring Boot Application Understanding Executable JAR Files Understanding Executable WAR Files Process of Packaging Automating Packaging Process Integrating Packaging with CI/CD Pipelines Creating Executable JAR and WAR Files Creating an Executable JAR File Creating an Executable WAR File Deploying to Tomcat Install Tomcat and Copy WAR File Start the Tomcat Server Verifying Deployment
  • 19.
    Hot Deployment andRedeployment Managing Tomcat Deployments Automating Deployment with CI/CD Deploying to Jetty and Undertow Why Jetty? Jetty Deployment Undertow Overview Undertow Deployment Deploying to Docker Deploying Spring Boot Application Deploying to AWS Setup EC2 Instance Install Java on EC2 Instance Transfer Application JAR/WAR File to EC2 Run Application Using AWS Elastic Beanstalk Using AWS Elastic Container Service Running Apps in Kubernetes Setting up Kubernetes Deploying Application to Kubernetes Creating Spring Boot Docker Images Workflow for Docker Images Sample Program: Creation of Docker Images
  • 20.
    Summary Chapter 5: SpringBoot Auto-configuration Chapter Overview Understanding Auto-configuration Auto-configuration Overview Key Components of Auto-configuration Sample Program: Auto-configuration using JPA and H2 Customizing Auto-configuration Overriding Default Beans Conditional Beans and Customization Customizing Configuration with @ConfigurationProperties Customizing Auto-configuration with Custom Annotations Exploring Spring Boot Starter POMs Using Conditional Beans Common Conditional Annotations Sample Program: Using Conditional Annotations Writing Custom Auto-configuration Custom Auto-configuration Workflow Sample Program: Writing Custom Auto-configuration Exploring Starter POMs Common Spring Boot Starter POMs Sample Program: Using Starter POMs
  • 21.
    Summary Chapter 6: DataAccess with Spring Data JPA Chapter Overview Introduction to Spring Data JPA Key Features of Spring Data JPA Up and Running with Spring Data JPA Configuring Data Source Adding Dependencies Defining Data Source Properties Creating JPA Entities Creating Repository Interfaces Implementing Service Layer Creating Controller Layer JPA Entities and Relationships Defining JPA Entities One-to-One Relationship One-to-Many and Many-to-One Relationships Many-to-Many Relationship Query Methods and Custom Queries Defining Query Methods Writing Custom Queries with @Query
  • 22.
    Using JPA CriteriaAPI Why Criteria API? Sample Program: Using JPA Criteria API Paging and Sorting with Spring Data JPA Brief Overview Setting up Paging and Sorting Handling Transactions in Spring Boot Enabling Transaction Management Using @Transactional Annotation Transaction Scenarios Additional Transaction Management Integrating with Liquibase and Flyway for Database Migrations Configuring Liquibase Configuring Flyway Performing Database Migrations Sample Program: Combining Liquibase and Flyway Summary Chapter 7: Building Web Applications Chapter Overview Introduction to Spring MVC Model-View-Controller Architecture Spring MVC Components
  • 23.
    Sample Program: Creatinga User Management System using Spring MVC Creating Controllers and Views Creating Controllers Creating Views Using Thymeleaf Templates Setting up Thymeleaf Basic Syntax and Expressions Creating a User Form with Validation Implementing User Details View Adding a CSS File for Styling Updating the Application to Serve Static Content Handling Form Submissions Form Binding with Thymeleaf Controller Method for Handling Form Submissions Adding Validation Constraints Handling Form Submission and Validation Errors Validating User Input Adding Validation Constraints to the Entity Updating Controller to Handle Validation Updating Form to Display Validation Errors Utilizing WebSockets Brief Overview Configuring WebSockets
  • 24.
    File Upload andDownload Handling Configuring File Uploads Creating a File Upload Controller Handling File Downloads Integrating Front-End Frameworks Integrating React with Spring Boot Integrating Angular with Spring Boot Summary Chapter 8: Testing Spring Boot Applications Chapter Overview Getting Started with Testing Background Types of Testing Unit Testing with JUnit and Mockito Setting up JUnit and Mockito Example 1: Unit Testing a Service Layer Example 2: Unit Testing a Controller Layer Conduct Slice Testing for Layer-Specific Tests Understanding Layer-Specific Tests Slice Testing for the Data Layer
  • 25.
    Slice Testing forthe Web Layer MockMVC for Web Layer Testing Introduction to MockMVC Setting up MockMVC Sample Program: Using MockMVC Testing Data Repositories Types of Data Repositories Sample Program: Testing Data Repositories Sample Program: Testing a Custom Repository Method Testing with TestContainers Setting up TestContainers Writing Integration Tests with TestContainers Performance Testing with JMeter Introduction to JMeter Setting up JMeter Sample Test Plan Summary Chapter 9: Security in Spring Boot Chapter Overview Explore Spring Security
  • 26.
    Introduction to SpringSecurity Core Components of Spring Security Configuring Basic Authentication Setting up Spring Security Customizing Basic Authentication Configuring URL Authorization Setting up URL Authorization Customizing Access Denied Handling Testing the Custom Access Denied Handler JWT, OAuth and OpenID Connect Setting up JWT Authentication Setting up OAuth and OpenID Connect Integrating with LDAP and Active Directory Setting up LDAP Integration Integrating with Active Directory Summary Index Epilogue
  • 27.
    GitforGits Prerequisites Whether you're aseasoned developer or just getting started, this book introduces you to geete comfortable with Spring Boot and take the most benefits of its tools to create high-quality apps quickly. All you need is to be just a basic programming experience with any of the languages to get started with. Codes Usage Are you in need of some helpful code examples to assist you in your programming and documentation? Look no further! Our book offers a wealth of supplemental material, including code examples and exercises. Not only is this book here to aid you in getting your job done, but you have our permission to use the example code in your programs and documentation. However, please note that if you are reproducing a significant portion of the code, we do require you to contact us for permission. But don't worry, using several chunks of code from this book in your program or answering a question by citing our book and quoting example code does not require permission. But if you do choose to give credit, an attribution typically includes the title, author, publisher, and ISBN. For example, "Spring Boot 3.0 Crash Course by Kit Harrington".
  • 28.
    If you areunsure whether your intended use of the code examples falls under fair use or the permissions outlined above, please do not hesitate to reach out to us at We are happy to assist and clarify any concerns.
  • 29.
    Chapter 1: Upand Running with Spring Boot
  • 30.
    Chapter Overview Let usstart with our first chapter, "Up and Running with Spring Boot," which will serve as the foundation for your skill-building transition into Spring Boot. This chapter will walk you through the core concepts and essential features that make Spring Boot a powerful framework for developing robust applications. You'll start by learning about Spring Boot and how it evolved from the Spring Framework, which will help you understand why it's so popular among developers today. As you progress, you'll discover the key features that set Spring Boot apart from other frameworks. Some of its features include an opinionated approach to configuration, the ability to build standalone apps, and the ability to integrate with different technologies seamlessly. Understanding these features will help you appreciate the efficiency and simplicity that Spring Boot adds to application development. You will then proceed to set up your development environment, ensuring that all required tools are installed and configured. This includes configuring your IDE, JDK, and other essential components. Following that, you will create your first Spring Boot application, giving you hands-on experience with the framework's capabilities. This practical approach will be supplemented by exploring Spring Boot dependencies and starter projects, which make dependency management and project setup easier. Finally, the chapter will go over Spring Boot annotations and the Spring Boot CLI. By the end of this chapter, you will have a solid understanding of Spring Boot, allowing you to delve deeper into its advanced features and capabilities in the following chapters.
  • 32.
    What is SpringBoot? Spring Boot has gained significant traction among developers for its ability to simplify the creation of stand-alone, production-grade Spring- based applications. It has become synonymous with rapid application development, offering a set of tools and features that streamline the entire development process. The modern developer community appreciates Spring Boot for its minimal setup, reduced boilerplate code, and the seamless integration it provides with other technologies. Emergence of Spring Boot Spring Boot emerged as an enhancement to the Spring Framework, addressing some of the complexities and configuration challenges developers faced with traditional Spring applications. The Spring Framework, introduced in 2003, brought a revolutionary approach to Java development by promoting loose coupling through dependency injection and aspect-oriented programming. However, as the Spring ecosystem grew, configuring and deploying Spring applications became increasingly intricate. This is where Spring Boot comes into play. Spring Boot was introduced to tackle these challenges by providing a convention-over-configuration approach. It simplifies the development process by offering default configurations and sensible defaults, which can be customized as needed. This allows developers to focus more on writing business logic rather than dealing with complex configurations.
  • 33.
    Relation to SpringFramework Spring Boot is essentially built on top of the Spring Framework, leveraging its core principles and components while abstracting much of the boilerplate configuration. This relationship ensures that Spring Boot applications inherit the robust and flexible nature of the Spring Framework but with added ease of use and productivity enhancements. At its core, Spring Boot provides: ● Pre-configured dependencies for various functionalities, reducing the need for manual dependency management. Automatically configures your application based on the dependencies you have added, ensuring minimal configuration effort. Enables the creation of stand-alone applications that can run independently without the need for an external web server. ● Integrates features like metrics, health checks, and externalized configuration out of the box. Recent Version Spring Boot has evolved significantly across its three major versions, each bringing new features, improvements, and refinements. Spring Boot 1.x
  • 34.
    The first majorrelease focused on establishing the foundation of the framework. It introduced key features like auto-configuration, starter dependencies, and embedded servers. This version laid the groundwork for making Spring applications easier to create and deploy. Spring Boot 2.x Building on the success of the 1.x series, Spring Boot 2.0 brought several enhancements. These included improved support for reactive programming with Spring WebFlux, enhanced Actuator endpoints for better monitoring, and integration with newer versions of the Spring Framework and other third-party libraries. The 2.x series also saw a focus on performance improvements and updated default configurations. Spring Boot 3.x The latest major release, Spring Boot 3.0, continues to refine the framework with modern features and support for the latest Java versions. It embraces new standards and best practices in the Java ecosystem, such as better support for GraalVM native images, enhanced observability with Micrometer, and further improvements in performance and memory management. Spring Boot 3.x also introduces new tools and integrations that align with contemporary development needs, such as better cloud- native support and advanced security features. Applications, Programs, and APIs
  • 35.
    Spring Boot iswidely used for developing robust web applications. Its integration with Spring MVC allows developers to create RESTful services with ease, handling various HTTP methods and providing JSON/XML responses out of the box. The microservices architecture has also gained popularity, and Spring Boot is a natural fit for building microservices. Its lightweight nature and ability to create stand-alone applications make it ideal for developing small, independent services that can be deployed and scaled individually. It is also commonly used to develop APIs that expose business logic and services to other applications. The ease of creating RESTful endpoints, along with features like Spring Security for securing APIs, makes it a preferred choice for API development. Spring Boot integrates with Spring Batch to facilitate batch processing, allowing for the development of applications that handle large volumes of data processing jobs. This is particularly useful in scenarios like data migration, ETL (Extract, Transform, Load) operations, and periodic tasks. With support for various messaging protocols and technologies like RabbitMQ and Kafka, Spring Boot simplifies the development of messaging-based applications. This is essential for building event-driven architectures and real-time data processing systems. Spring Boot's compatibility with cloud platforms like AWS, Azure, and Google Cloud Platform makes it an excellent choice for developing cloud- native applications. Features like externalized configuration, seamless integration with cloud services, and support for containerization through Docker make Spring Boot a powerful tool for modern cloud deployments. Spring Boot can also be used to create command-line applications. The Spring Boot CLI (Command Line Interface) allows for rapid prototyping
  • 36.
    and execution ofSpring Boot applications directly from the command line, making it useful for scripting and automation tasks. Spring Boot supports GraphQL, enabling the development of APIs that allow clients to request exactly the data they need. This is particularly beneficial for applications requiring efficient data retrieval and flexible querying capabilities. And, with the introduction of Spring WebFlux, Spring Boot supports reactive programming, allowing the creation of reactive, non-blocking applications. This is particularly useful for building high-performance, scalable applications that need to handle a large number of concurrent connections.
  • 37.
    Key Features ofSpring Boot Spring Boot's widespread adoption and popularity among developers stem from its powerful and efficient features that significantly enhance the development experience. Following are the ost appealing features highlighting how they simplify application development and improve productivity: Auto-configuration One of the most acclaimed features of Spring Boot is its auto- configuration capability. Auto-configuration reduces the need for manual setup by automatically configuring Spring applications based on the dependencies present on the classpath. For example, if you include a dependency for a database in your project, Spring Boot will automatically configure a DataSource bean. This feature drastically minimizes boilerplate code and configuration files, allowing developers to focus on writing business logic. Spring Boot Starters Spring Boot starters are a set of convenient dependency descriptors that you can include in your project. They aggregate commonly used dependencies into a single dependency, simplifying the process of adding and managing libraries. For instance, the spring-boot-starter-web starter includes dependencies for Spring MVC, Jackson for JSON processing, and an embedded Tomcat server. By using starters, you can easily set up a
  • 38.
    Spring Boot projectwithout having to manually specify each dependency, thus speeding up development time. Embedded Servers Spring Boot allows you to create stand-alone applications by embedding web servers like Tomcat, Jetty, or Undertow directly within the application. This eliminates the need to deploy your application to an external server. By default, Spring Boot uses Tomcat as the embedded server, but you can easily switch to Jetty or Undertow if required. This feature enables rapid development and testing, as you can run your application directly from your IDE or command line without additional server configuration. Production-Ready Features Spring Boot comes with a variety of built-in features that help you monitor and manage your application in production environments. The Actuator module provides a range of endpoints that offer insights into the application's health, metrics, and configuration. These endpoints can expose information such as application health status, environment properties, and metrics like memory usage and request counts. Additionally, Spring Boot supports integration with external monitoring tools like Prometheus and Grafana, making it easier to keep an eye on your application's performance and health. Externalized Configuration
  • 39.
    Managing configuration propertiesin a flexible and efficient manner is crucial for any application. Spring Boot's externalized configuration feature allows you to define configuration properties in various formats, including properties files, YAML files, environment variables, and command-line arguments. This flexibility makes it easier to manage configuration across different environments, such as development, testing, and production. You can use profiles to group configuration properties and switch between them seamlessly, ensuring your application behaves correctly in each environment. Spring Boot CLI The Spring Boot Command Line Interface (CLI) is a powerful tool for rapid prototyping and development. It allows you to write Groovy scripts to run Spring Boot applications without requiring a full project setup. The CLI is particularly useful for creating quick prototypes, running small utilities, or testing out new features. With the Spring Boot CLI, you can quickly create and execute Spring Boot applications directly from the command line, making it a handy tool for developers who need to test and experiment rapidly. DevTools Spring Boot DevTools is a development-time feature that enhances the developer experience by providing tools and utilities that streamline the development process. One of the key features of DevTools is automatic restart, which reloads the application context whenever there are changes in the classpath. This reduces the time spent restarting the application manually. DevTools also includes features like live reload, which refreshes the browser automatically when resources change, and remote
  • 40.
    debugging support, allowingyou to debug your application running in a remote environment. Spring Initializr Spring Initializr is an online tool that helps you bootstrap a new Spring Boot project quickly. It provides a web-based interface where you can select the desired project metadata, dependencies, and other options. Once you specify your preferences, Spring Initializr generates a fully configured Spring Boot project that you can download and import into your IDE. This tool simplifies the initial setup process, enabling developers to start coding their applications immediately. Actuator Spring Boot Actuator is a set of production-ready features that help you monitor and manage your Spring Boot application. It provides various endpoints that expose application health, metrics, info, environment properties, and other operational details. These endpoints can be customized to control which information is exposed and who can access it. Actuator is essential for gaining insights into the application’s runtime behavior and health, making it easier to detect and diagnose issues in production environments. Spring Boot DevTools Spring Boot DevTools is a development-time module that boosts developer productivity by providing features like automatic restarts, live reload, and configurations for debugging. Automatic restarts help reduce
  • 41.
    the time spenton manual restarts after code changes, while live reload refreshes the browser automatically when static resources are modified. DevTools also simplifies remote debugging, allowing you to connect your debugger to a running application without complex setup. Simplified Dependency Management Spring Boot simplifies dependency management by providing a set of starter POMs that bundle commonly used dependencies. These starters reduce the complexity of managing dependencies individually and ensure compatibility between different library versions. For instance, adding the spring-boot-starter-data-jpa starter includes dependencies for Spring Data JPA, Hibernate, and a database connection pool, all of which are tested to work well together. Simplified Testing Testing is a crucial part of application development, and Spring Boot makes it easier by providing extensive support for unit and integration testing. Spring Boot integrates seamlessly with testing frameworks like JUnit and TestNG, and it includes specialized test utilities like Spring Boot Test. This module provides annotations and utilities that simplify the setup and execution of tests, such as @SpringBootTest, which loads the complete application context for integration tests, and @WebMvcTest, which focuses on testing the web layer. Application Metrics and Health Checks
  • 42.
    Monitoring application performanceand health is vital in production environments. Spring Boot Actuator provides endpoints for gathering various metrics and health information about your application. Metrics include data on memory usage, CPU usage, HTTP request metrics, and more. Health checks provide information about the status of various components, such as databases, message brokers, and external services. This information helps you ensure that your application is running smoothly and efficiently. Security Integration Spring Boot seamlessly integrates with Spring Security, providing a robust and flexible security framework for your applications. With minimal configuration, you can secure your applications using various authentication and authorization mechanisms, such as form-based login, OAuth2, and JWT. Spring Boot also supports method-level security, allowing you to enforce security rules on specific methods within your application. This integration ensures that your applications are secure without requiring extensive setup. Integration with Other Spring Projects Spring Boot integrates effortlessly with other Spring projects, such as Spring Data, Spring Batch, Spring Integration, and Spring Cloud. This integration allows you to leverage the full power of the Spring ecosystem, building comprehensive and scalable solutions. For instance, you can use Spring Data to simplify database interactions, Spring Batch for batch processing, Spring Integration for messaging and integration, and Spring Cloud for building cloud-native microservices. The seamless integration
  • 43.
    between these projectsensures that your applications are cohesive and easy to manage. Reactive Programming Support With the introduction of Spring WebFlux, Spring Boot now supports reactive programming, enabling you to build reactive, non-blocking applications. Reactive programming is particularly useful for applications that need to handle a large number of concurrent connections, such as real-time messaging systems and streaming applications. Spring WebFlux provides a reactive stack built on Project Reactor, offering a functional programming model that enhances the scalability and performance of your applications. GraalVM Native Image Support Spring Boot 3.x introduces support for GraalVM native images, allowing you to compile your Spring Boot applications into native executables. Native images offer several benefits, including faster startup times and reduced memory consumption. This feature is particularly useful for cloud-native applications and serverless environments, where resource efficiency and quick startup are critical. Spring Boot's integration with GraalVM ensures that your applications can take advantage of these benefits with minimal configuration changes. Spring Boot's such exemplary set of features makes it a reliable platform for developing modern Java applications, with a strong emphasis on convention over configuration, coupled with its production-ready capabilities. Using these features, you can stay focussed on writing
  • 44.
    business logic, whileSpring Boot totally handles the underlying complexities of application development.
  • 45.
    Setting up DevelopmentEnvironment To start developing with Spring Boot, you'll need to set up your development environment. This involves installing necessary software, configuring your Integrated Development Environment (IDE), and creating a basic project structure. Installing JDK Spring Boot requires the JDK to compile and run applications. Spring Boot 3.x supports JDK 17 or higher. You can download the latest version of the JDK from the official Oracle website or use an open-source alternative like OpenJDK. Once downloaded, follow the installation instructions specific for Windows: ● Run the JDK installer and follow the prompts to complete the installation. Set the JAVA_HOME environment variable to point to the JDK installation directory. This can be done through the System Properties > Environment Variables menu. Add the JDK's bin directory to the PATH environment variable to ensure Java commands are accessible from the command line. Installing IDE
  • 46.
    An IDE isessential for efficient coding and project management. IntelliJ IDEA and Eclipse are popular choices for Spring Boot development due to their robust support for Java and Spring projects. To install IntelliJ IDEA, Download and install IntelliJ IDEA from the JetBrains website and remember the Community Edition is freely available to download and considered suitable too for most development tasks. Once installed, open IntelliJ IDEA and configure it for Java development by selecting the appropriate JDK. Installing Apache Maven Apache Maven is a powerful build automation tool used for managing project dependencies and building Java applications. Spring Boot uses Maven to manage dependencies, build projects, and run applications. You can download Maven from the official Apache Maven website. To install Maven, ● Download the binary zip archive from the Apache Maven website. ● Extract the archive to a suitable location on your system.
  • 47.
    Add the bindirectory of the extracted Maven folder to the PATH environment variable. Installing Spring Boot CLI The Spring Boot Command Line Interface (CLI) is a useful tool for quickly developing Spring applications using Groovy scripts. It simplifies the process of creating and running Spring Boot applications without requiring a full project setup. To install Spring Boot CLI, ● Download the Spring Boot CLI distribution zip file from the official Spring website. ● Extract the zip file to a directory of your choice. ● Add the bin directory of the extracted folder to the PATH environment variable. ● Verify the installation by opening a command prompt and typing spring Creating Spring Boot Project Spring Initializr is a web-based tool that helps you generate a Spring Boot project with a pre-configured structure and dependencies. You can access Spring Initializr
  • 48.
    To use SpringInitializr, ● Open the Spring Initializr website. ● Fill out the project metadata fields, such as Group, Artifact, and Name. Select the desired dependencies for your project, such as Spring Web, Spring Data JPA, or Spring Security. ● Choose the project type (Maven Project) and packaging type (Jar). ● Select the appropriate Java version (e.g., 17) and Spring Boot version (e.g., 3.x). ● Click "Generate" to download the project as a zip file. ● Extract the zip file and open the project in your IDE. Configuring IDE After creating your Spring Boot project, you need to configure your IDE to enhance your development experience. In IntelliJ IDEA,
  • 49.
    Open the projectby selecting File > Open and navigating to the extracted project directory. IntelliJ IDEA will automatically detect the project structure and import it as a Maven project. Ensure the correct JDK is configured for the project by selecting File > Project Structure > Project and setting the Project SDK. Install the Spring Boot plugin (if not already installed) to enable additional features like Spring Boot-specific code assistance and configuration. Running first Spring Boot App With your development environment set up, you can now run your first Spring Boot application. Spring Boot applications can be started directly from your IDE or the command line. From IntelliJ IDEA, Locate the main application class, which is annotated with This class typically contains a main method that starts the application. ● Right-click the main application class and select Run. From the Command Line, ● Open a command prompt and navigate to the project directory.
  • 50.
    ● Run thecommand mvn spring-boot:run to start the application. Exploring Project Structure A typical Spring Boot project has a well-defined structure that includes several important directories and files: src/main/java: Contains the application's main source code. This is where you will write your Java classes and Spring components. ● src/main/resources: Contains application resources like configuration files, static assets, and templates. ● src/test/java: Contains test classes and test resources. ● pom.xml: The Maven build file that specifies project dependencies and build configuration. Adding Dependencies Spring Boot uses Maven to manage dependencies. To add a new dependency, you simply update the pom.xml file with the desired dependency. For example, to add Spring Web dependency, include the following in the section:
  • 51.
    org.springframework.boot spring-boot-starter-web After updating thepom.xml file, your IDE will automatically download and resolve the new dependencies. Configuring Application Properties Spring Boot applications use a configuration file to manage application settings. By default, this file is named application.properties and is located in the src/main/resources directory. You can use this file to define various properties such as server port, database connection details, and logging settings. For example, to change the default server port, add the following line to the application.properties file: server.port=8081 Spring Boot DevTools Spring Boot DevTools is a useful development-time feature that enhances the developer experience by providing tools like automatic restarts and live reloads. To use DevTools, add the following dependency to your pom.xml file:
  • 52.
    org.springframework.boot spring-boot-devtools true DevTools will automaticallyrestart your application whenever you make changes to the classpath, reducing the time spent on manual restarts. Spring Boot CLI Spring Boot CLI is a command-line tool that allows you to run Spring Boot applications using Groovy scripts. This tool is particularly useful for prototyping and testing small applications, and to create and run a Spring Boot application with the CLI, you must follow these steps: ● Create a new Groovy file with the .groovy extension. ● Write a simple Spring Boot application in Groovy. For example: @RestController class HelloController { @RequestMapping("/")
  • 53.
    String hello() { "Hello,GitforGits Publishing!" } } Save the file and run it using the Spring Boot CLI by executing the command spring run .groovy in the terminal. This will start the Spring Boot application, and you can access it by navigating to http://localhost:8080 in your web browser. So, you are now ready to start building Spring Boot applications.
  • 54.
    Creating First SpringBoot Application This section will teach and lead you through the steps of building a simple RESTful web service using Spring Boot, along with a hands-on introduction to the framework's capabilities. Setting up the Project Start by creating a new Spring Boot project using Spring Initializr, as outlined previously. For this example, select the following dependencies: ● Spring Web ● Spring Boot DevTools Fill out the project metadata (Group, Artifact, Name, etc.) and download the generated project as we learned in the previous section. Extract the project and open it in your chosen IDE. The generated Spring Boot project has a well-defined structure: ● src/main/java: Contains the main application code. ● src/main/resources: Holds application configuration files and static resources. ● src/test/java: Contains test classes.
  • 55.
    Random documents withunrelated content Scribd suggests to you:
  • 56.
    LEWIS H. HUBBARD. LewisH. Hubbard, farmer and stockman, of Kapioma township, Atchison county, was born March 13, 1872, in Cass County, Missouri. He is a son of Simeon and Mary Ann (Pence) Hubbard, who were the parents of the following children: William, Kapioma township, Atchison county, Kansas; Lillie O’Conner, widow, Muscotah, Kan.; Cora Routh, Kapioma township; Lewis, subject of this sketch, and two children who died in infancy. The father of Lewis Hubbard was born March 10, 1840, in Indiana, and grew up as a farmer, following that occupation after coming to Kansas in 1874. He settled near Muscotah and rented land for a period of four years and during that time he saved his money carefully. When he came to Kansas he was without funds, but at the end of four years he had accumulated enough to enable him to buy a farm. In addition to growing his crops he fed stock and did a hustling business in that line. He is still living and resides at Muscotah, Kan. The mother of Lewis Hubbard is also living. Lewis Hubbard went to school in the Rose Valley district. He received a common school education and worked with his father on the latter’s farm until 1909, when he bought a farm of his own and became his own manager. The place consisted of 160 acres of fine tillable soil and is located in section 16, southeast quarter of Muscotah township. Mr. Hubbard has devoted considerable attention to improving the appearance of his farm and has constructed a fine seven-room cottage, and has built a large barn to provide shelter for his stock and hay. He keeps the best Jersey cows and milks eight to twelve of them for the dairy. Mr. Hubbard is a stockholder in the farmers’ grain elevator at Muscotah, Kan. In 1897 Mr. Hubbard married Anna Hinkston, who was born May 5, 1880, in Doniphan county, Kansas. She is a daughter of Frank and Dorinda (Tate) Hinkston, who now live in Jackson county, Kansas. Mr. and Mrs. Hubbard are the parents of two children, as follows: Ethel, aged sixteen, who attends the Atchison County High School at Effingham, and Leslie, aged seven, living with his parents. The daughter is also studying music, and her father hopes to give her a thorough education in that subject. Mr. Hubbard is a Democrat of
  • 57.
    an independent stamp.He is a member of the Adventist church and is a deacon in that denomination. If there is one thing that Mr. Hubbard takes pride in more than another it is in his children’s education. He realizes the value of an education and desires that his children have every advantage of education that he can give them.
  • 58.
    ARTHUR S. SCHURMAN. Atchisoncounty is principally an agricultural community, and not unlike most sections of the great Middle West, the general wealth and standing of the community is commensurate with the thrift, enterprise and industry of the individual farmers. He whose name introduces this sketch is a representative of that type of men whose efforts have placed Atchison county in the foremost rank of the 110 political sub-divisions of the great state of Kansas. Arthur S. Schurman is one of the substantial and enterprising agriculturists in Benton township, and has been a resident of the township for the past thirty years. He is the owner of 202 acres of well improved land, which is noted for its excellent yields of grain. For the past ten years Mr. Schurman has been one of the most successful wheat growers in Atchison county, or even in the State. He has produced the great yield of 2,330 bushels of wheat on a tract of eighty acres. A handsome farm residence, tastefully painted a clean white, presents an attractive appearance on a rise of land fronting the highway, which passes east and west in front of his land. This fine home was built by Mr. Schurman in 1911, and comprises eleven rooms in all, with a heating and water pressure system, which completely modernizes the home. The residence is nicely situated in the midst of a fine grove, which affords a generous shade in summer. Mr. Schurman carries on diversified farming and raises a considerable amount of live stock. Arthur S. Schurman was born January 11, 1864, in Prince Edward Island, Dominion of Canada, and is a son of Caleb Schurman, who was born December 8, 1829, on Prince Edward Island, a son of English parents, who left their native land and settled on the island many years ago. The great-grandfather of Arthur Schurman was a German by birth, who established a home in England. The mother of Arthur S. was Sarah Creswell before her marriage. She was born May 15, 1835, and died on the home place in Benton township, November 15, 1889. When but a child she went from England to Prince Edward Island with her parents. The
  • 59.
    Schurman family livedon their native island until 1876, and then immigrated to the United States, going first to Des Moines, Iowa, in search of a suitable location. After a residence of eight months in Des Moines, the family came to Atchison, Kan., where Arthur Schurman was employed in a harness shop for three years, and also drove a coal wagon for a retail coal dealer for a time. Caleb Schurman rented a farm south of Atchison, and later bought the farm now owned by his son, Arthur. Four children were born to Caleb and Sarah Schurman, namely: Mrs. J. B. O’Connell, Denver, Colo.; Frederick Robert, a resident of Effingham, Kan.; Percy Ernest, who died in September, 1896, and Arthur S., the oldest of the family. Arthur Schurman was twelve years of age when the family came to the United States, and received a portion of his schooling in his native land. He remained with his father, and assisted him in developing his Atchison county farm, purchasing the land from his father when he came to man’s estate. Caleb Schurman makes his home with his son, Arthur S., who married in August of 1890, to Emma Pruitt, of Atchison, Kan., a daughter of James Pruitt. This marriage has been blessed with the following children: Sadie Mary, born October 5, 1892, the wife of Fred Dooley, of Lancaster township; Martha, born April 3, 1893: George Herbert, born September 21, 1895; Arthur Ernest, born June 3, 1899, and died October 19, 1900: Ralph, born March 25, 1902. Mr. Schurman is a Republican, but has never found time to take an active part in political affairs. He was reared in the Episcopalian faith. but the members of his family attend the Christian church at Effingham. He is a member of the Masonic lodge and the Central Protective Association.
  • 60.
    C. A. LILLY,M. D. C. A. Lilly, M. D., a well known member of the medical profession of Atchison county, is a native of the Buckeye State. He was born at Mansfield, Ohio, and is a son of S. and Clara (Beard) Lilly. The father was a lumberman. Dr. Lilly was reared and educated in Mansfield, Ohio, and Chicago, Ill., and after obtaining a good academic and classical education, he entered the Chicago Medical College in 1897 and was graduated in the class of 1901 with the degree of Doctor of Medicine. He then came to Kansas and engaged in the practice of his profession at Seneca. After remaining there about one year and a half he returned to Chicago and took a post- graduate course in Rush Medical College, and did considerable hospital work. In 1904 he located in Atchison, where he has since been successfully engaged in the practice of medicine and has one of the extensive practices of Atchison county. He has been division surgeon for the Missouri Pacific railroad since 1911. Dr. Lilly was united in marriage in 1902 to Miss Isabel Smith, of Hiawatha, Kan. Dr. Lilly is a member of the Northeastern Kansas and the Missouri Valley Medical associations and also belongs to the County, State and American Medical association.
  • 61.
    FRANK J. WATOWA. FrankT. Watowa, a successful farmer of Shannon township, Atchison county, was born in Jefferson county, Wisconsin, October 3, 1854, and is a son of Joseph and Catherine Watowa, natives of Austria, who emigrated from their native land to Wisconsin where they resided until 1860, when they came to Missouri, locating in Buchanan county. About 1870 the family came to Atchison and located on a farm in Shannon township where his son, Joseph H. Watowa, now resides. The father died in 1895. Frank J. Watowa is one of a family of seven children, born to Joseph and Catherine Watowa, as follows: Mary, Henry, Joseph H., Mollie, Earnest, Paullina and Frank. Frank J. Watowa was married in 1879 to Miss Anna Falk, who died in 1885, leaving three children, as follows: Mary, the wife of Antone Lutz, of Lancaster township; Josephine resides in Colorado Springs, Colo., and Anna, deceased. On June 24, 1892, Mr. Watowa was united in marriage to Amanda Smith, and four children have been born to this union, as follows: Sarah, Frances, Frank and Lawrence. Mr. Watowa is one of the extensive farmers of Atchison county. He has 280 acres of land, nicely located and very productive. In 1895 he built a handsome stone residence, which is one of the finest farm homes to be found in the county. Politically he is a Democrat, and he and his family are members of the Catholic church. He is a progressive and public spirited citizen and one of the substantial men of Atchison county.
  • 62.
    LEWIS BRADLEY. Lewis Bradley,farmer and stockman, of Kapioma township, Atchison county, was born February 24, 1857, in Henderson county, Illinois, and is a son of Hamilton J. and Sarah E. (Pence) Bradley. The father was born in Steuben county, New York, October 27, 1834. He followed the stonemason’s trade. Coming to Atchison county, Kansas, several years later, in 1880, bought the farm of 160 acres which his son now owns. He came to Kansas with very little capital, but was able to save enough money to buy 160 acres in Canadian county, Oklahoma. His death occurred May 24, 1914. The mother, who died March 8, 1908, was born in Lycoming county, Pennsylvania, May 14, 1837. Lewis Bradley, the subject of this sketch, spent the first few years of his life in Illinois, Missouri and Iowa, and then was brought to Kansas by his parents in 1874. He farmed with his father until 1898, when he bought the home farm and built a fine nine-room house on the place, a two-story dwelling. In 1913 he erected a large barn, 48×60 feet, and keeps the best graded stock. Mr. Bradley was married September 5, 1881, to Minnie Streeter, who was born in Boone county, Illinois, October 28, 1865. She is a daughter of Rev. William H. and Hanna (Vandicar) Streeter, both natives of Watertown, N. Y. Mr. Streeter came to Kansas in 1870. He was a Methodist minister and established churches all over Kansas. He was born September 16, 1825, and died February 28, 1911. Hanna, his wife, was born May 16, 1826, and died July 29, 1879. Mr. and Mrs. Bradley have four children as follows: Maud married Albert Williams, railroad contractor, Muscotah, Kan., who is a graduate of the county high school and taught for fourteen years; Bessie, deceased; Henry, living at home, graduate of business college of Kansas City, Mo.; Leslie married Miss Mabel Swisher, and has three children, Elberta, Clarence and Bessie. Mr. Bradley is a Republican, and belongs to the Modem Woodmen of America and to the Mystic Workers of the World. He and his wife were charter members of the Advent Christian church at Muscotah. Mr. Bradley is the oldest living of a family of eleven children; the others living are: Lavelle Green, Levi, Ellen Sheets, Elmer, May Sommers, and Mary Raasch.
  • 63.
    ALFRED J. HAMON. AlfredJ. Hamon, farmer, stockman and builder, is one of those self-made men whose careers demonstrate to our growing youths the possibilities of industry and good management. Born with no unusual gifts and of parents who were only in moderate circumstances, he has, by his own efforts, built up a worthy name for himself in the community in which he lives. Mr. Hamon was born in Kapioma township, Atchison county, Kansas, July 10, 1863. He was one of five children born to William and Leanah (Brutton) Hamon. Emma Royer, the oldest child, is dead; Alfred, the subject of this sketch, is the second in order of birth. The others are: Nancy Heimbach, Effingham, Kan.; John, Jefferson county, Kansas: Samuel, Kapioma township. The father was a Kentuckian, born in 1835, and during part of his young manhood he farmed in his native State. Coming to Kansas in the early days, he homesteaded 160 acres in Kapioma township, Atchison county. This land was covered with timber, and rather than attempt to clear it, he traded it for prairie land which composed the farm on which he lived until his death in 1873, and his widow is living on the farm in Kapioma township, at the age of seventy-six years. Alfred Hamon grew up on the farm and attended school at Cole Creek district a few months each year, and at the age of twenty-one he started out for himself, renting a farm. Three years later he bought the place and owned it three years. He then worked at the carpenters’ trade in Atchison for three years and during this time he worked in many places around Atchison and helped erect some of the more important buildings, which were constructed during that time. Another two years was spent on the farm in Kapioma township, and Mr. Hamon returned again to Atchison to work at his trade. Carpenter work appealed to him more than farming and he spent twenty-three years handling the plane and the saw. For thirteen years of this time he did contracting and supervised the erection of many buildings. Meanwhile he accumulated considerable property in Atchison, and in 1906, the exacting work of carpentry became tedious to Mr. Hamon, and he returned to farming, after twenty-
  • 64.
    three years inAtchison. He had eighty acres of well improved land in Kapioma township, section 23. He built a fine house and barn, utilizing his experience in construction work to put up the best buildings that the money would afford. His improvements cost $4,000. Mr. Hamon was a real farmer as well as a carpenter. In 1911 he won first prize with an exhibit of yellow corn at the Muscotah fair. In 1884 he married Emma Tull, who was born in October, 1863, in Kapioma township, Atchison county. She is a daughter of John and Hanna H. (Rust) Tull, Virginians, who settled in Atchison county at an early date. Mr. and Mrs. Hamon have five children as follows: Effie, deceased; Edna Piper, California: Susan Clark, of Kansas City, Kan.; Roy and Ruth, living at home. Mr. Hamon is a member of the Christian church. He is a Republican and has been a member of the school board in his township.
  • 65.
    JOHN GRIFFIN. John Griffin,farmer and stockman, of Kapioma township, Atchison county, Kansas, is a native of Kansas, having been born on the farm where he now lives March 25, 1882. His parents, Lawrence and Ellen Griffin, lived on the farm in Kapioma township. John Griffin was brought up on the farm and when a small boy divided his time between chores and school at district No. 60, Kapioma township, and later attended St. Benedict’s College at Atchison, Kan. Considering the time spent in school, John started out in life remarkably early, making his first venture at the age of eighteen, renting a farm from his father. He continues to work the farm rented from his mother at the present time. On October 15, 1912, John Griffin married Christena Hanson. Mrs. Griffin was born November 12, 1885, in Doniphan county, Kansas. Her parents, Nels and Christena (Henderson) Hanson, were natives of Denmark, who came to Doniphan county, Kansas, about 1870, where they engaged in farming. The father died in 1892, at the age of fifty. The mother is living with her son, Crist Hanson, in Kapioma township, Atchison county, and is sixty-three years old. Mrs. Griffin attended the district schools in Doniphan county, Kansas. Mr. Griffin is a member of the Catholic church, and politically, has affiliated himself with the Democratic party. Mr. Griffin is a conscientious citizen and a hard worker.
  • 66.
    DAVID BEYER. David Beyer,farmer and stockman of Kapioma township, Atchison county, was born August 29, 1866, in Clearfield county, Pennsylvania. He was the fourth child born to Asa and Susan Beyer, who were the parents of eleven children, ten of whom are living, as follows: Mary Lewton, Benton township; Samuel, Kapioma township; Christena High, Texas; David, the subject of this sketch; Jane, living on the home place; Clarissa, deceased; Martha Schiffbauer, Sumner county, Kansas; John, banker, Arrington, Kan.; Albert, Caldwell, Kan.; Luctria Dodson, Kapioma township; Mabel B. Royer, Kapioma township, Atchison county. Asa Beyer, the father of David, was a carpenter by trade; he was born in Pennsylvania in 1835, and after following his trade in his young manhood, came to Kansas in 1868, and bought an eighty-acre farm in Kapioma township, Atchison county. He gradually increased his holdings to 340 acres, which he owned at the time of his death in 1898. The mother of David Beyer is a Pennsylvanian also and is now living on the home place in Kapioma township. David attended district school in Pennsylvania and started out to shift for himself at the age of twenty-one. When he came to Kansas and bought the eighty-acre farm, there were no improvements on the place. In 1892, he built a substantial house and in 1907, he built a fine two-story, ten-room house, and modern in every respect. In 1911 he built a large barn, 36×52 feet. Mr. Beyer now owns 258 acres of land which were formerly owned by his father. In 1897 Mr. Beyer married Anna Cawley, who was born in Atchison, Kan., June 30, 1862. She is a daughter of John and Margaret (Welch) Cawley, both natives of Ireland. They were early settlers in Atchison, having come here in 1858. Later they came to Kapioma township. Mr. and Mrs. Beyer are the parents of three children, as follows: Asa, Marie and Margaret, all living at home. Mr. Beyer attends church regularly though he is not a member of any denomination. He belongs to the Independent Order of Odd Fellows. He is a Republican, and has served as township treasurer.
  • 67.
    GEORGE W. GIBSON. GeorgeW. Gibson, farmer, of Kapioma township, Atchison county, was born May 16, 1855, in Clearfield county, Pennsylvania. He is a son of Jacob and Leah (High) Gibson, who were the parents of eleven children, eight of whom are living. The father was born in Maryland, and the mother in Pennsylvania. They came to Kansas in 1871 and settled in Kapioma township, Atchison county. Here the father bought 160 acres of land and erected a small house on it. In the early days when he was just getting on his feet financially, he had to economize at every point and to begin with built a straw barn. Later, he improved the farm until it was a modernly equipped place. Mr. Gibson lived on this farm until his death in 1900, at the age of seventy-six years. The mother died the following year at the age of seventy. George Gibson, the subject of this sketch, attended the district schools in Pennsylvania, Illinois and Kansas. At the age of twenty- one years he started out to farm for himself. He rented land for a year when he engaged in teaching at Larkinburg, Jackson county, Kansas. Later he taught at Arrington, Atchison county, and, altogether, Mr. Gibson taught school for three years. He then bought eighty acres of unimproved prairie land, which he broke and improved. Mr. Gibson used good judgment in his investments and was successful in every venture. He now owns 840 acres of land in Kansas and Texas. The farm on which he lives, is modern in every respect and he has built an especially fine barn on it. In 1880 Mr. Gibson was married to Elizabeth Miller, who was born May 9, 1860, in Atchison county, Kansas. She is a daughter of James and Eliza (Russell) Miller. The father was born in Clay county, Missouri, August 3, 1831, and was a son of Moses Miller, a Kentuckian. James Miller spent his early days in the West, working for the Government. Later he became a large cattle breeder in Atchison county and came to be known as the “Cattle King” because of his extensive activities in the cattle business. He died at Mscotah, Kan., September 12, 1913, and the mother of Mrs. Gibson died in
  • 68.
    1879. She wasa native of Iowa. Mr. and Mrs. Gibson have nine children: Daisy M. Anderson, of Muskogee, Okla., who was graduated from the Kansas Western Business College, and later taught school in Kansas and Colorado; Dr. Frank C. Gibson, a graduate of the Physicians’ and Surgeons’ School of Chicago, now practicing in Bovill, Idaho, where he is surgeon for a railroad company and has charge of a hospital; Charles R., farmer, Kapioma township, Atchison county; Lucy M. Irwin, Dallas, Texas; Harry L., farmer on the home place; Ruth, attending Kansas University, Lawrence; George W., Jr., John and William, living at home. Mr. Gibson is an independent progressive Republican. He has held the township offices of clerk, treasurer and trustee.
  • 69.
    FRANK J. HUNN. FrankJ. Hunn has combined the activities of banker, public citizen, farmer, and stockman, with the refinements of education, and lives today as an example of an all around man of influence. Mr. Hunn is a native Kansan, having been born in Garfield township, Jackson county, Kansas, March 2, 1860. He comes of parentage of the sturdy pioneer type, brave, but God-fearing. The father, Joseph Hunn, was born in 1815, of English descent, being a son of a London minister. He was a native of Connecticut and lived there until he was of middle age. Coming to Kansas in 1857, he preëmpted a claim one mile east and a mile north of Arrington, Atchison county, Kansas. Here he constructed a cabin home and lived in the rough life of the frontier. But this was not new to Joseph Hunn, for he had been one of that vast army of adventurers who crossed the western plains in “forty-nine,” to seek gold in California. For four years he had undergone the hardships of prospecting and the rigors of Kansas winters weighed less heavily on him than they did on many settlers. After two years on the Atchison county place, he sold out and removed to Larkin, Jackson county, Kansas, living there until 1865, when he took possession of the farm now owned by his son, Frank J. The father died two years later, leaving his wife, Elizabeth, with two children, Frank, and a daughter, Bessie, since married to Mr. Kathrens, a merchant, of Arrington, Kan. Elizabeth Hunn, whose maiden name was Redman, is of English and German descent, coming from a line of religious ancestors, all of her family being of a devout nature. She was born in 1825, and died December 16, 1912, having lived a long and useful career. After the death of her husband she was occupied with the management of the farm, but in her younger days she led a life full of service to others. She worked as a nurse among the sick in the early times, when medical attention was expensive and hard to get, and her efforts saved untold suffering and expense to many settlers. She was a school teacher in Iowa for some time, and always took a great deal of interest in the affairs of the church and Sunday school. Until two years before her death Mrs. Hunn taught a Sunday school class at the
  • 70.
    Arrington Methodist church,and, although she was eighty-five years old, her age never kept her away from her class. She was always on time and in her place and constantly set a good example for younger persons. With such persons for parents it is to be expected that Frank Hunn would develop into a good citizen. With the high ideals instilled in his young mind, Frank when a boy was encouraged to study hard at school, and when he finished the graded courses at the Arrington school, he went to Campbell College, at Holton, Kan. Here he spent a short time, and at the age of twenty-two years began farming for himself. In 1893 he bought his father’s old place and has since increased it to 250 acres. But his activities do not stop at the limits of his farm. He has broken the isolation of the farmer and has taken an active part in affairs for the good of the community. He is recognized as a conservative, shrewd business man, and now is president of the Arrington Bank, a position of trust and responsibility. The fact that his fellow-shareholders in the enterprise were willing to place such an honor upon him is proof of his character and achievements. He takes a great deal of interest in Shorthorn cattle and is recognized as a breeder of fine strains. He also keeps graded horses and hogs. In 1894 Mr. Hunn was married to Susie Gibson. (A sketch of her brother, George W. Gibson, appears elsewhere in this volume.) Mrs. Hunn was born in January, 1860, in Pennsylvania, and was a teacher in the district school of Kapioma township before her marriage. Mr. and Mrs. Hunn are the parents of three children, the oldest of whom is Frank, a graduate of Effingham high school, now living at home; Edna and Mildred, the other two children, also live with their parents. Mr. Hunn attends the Methodist church, although he is not a member. He is an independent voter, preferring to cast his ballot for the man whom he thinks will make the best official regardless of party affiliations. He has held the office of township clerk, township trustee, and township treasurer, which positions he filled in a praiseworthy manner. At present Mr. Hunn is a member of the school board of Kapioma township.
  • 71.
    AUGUST J. WOLF. AugustJ. Wolf, farmer and stockman, of Atchison county, was born October 17, 1862, in Doniphan county, Kansas. He is a son of Gottlieb and Joehanna Wolf, who were the parents of fourteen children, seven of whom are living. The parents of August Wolf were born in Germany and both grew up there and were married in the capital city. In 1860 they left the Fatherland with their five children and came to Doniphan county, Kansas, where they engaged in farming. In 1880, they came to Atchison county, Kansas, and bought the farm of 240 acres which is now owned by their son, August, the subject of this sketch. Five years later they moved to Atchison, Kan., where the father died in 1904, at the age of eighty-five years. The mother died in 1914, at the age of eighty-one. August Wolf grew up on his father’s farm and at the age of twenty-seven started out to shift for himself. He rented his father’s farm, and also helped his father in the threshing business. While feeding a thresher he had his right hand torn off. This, of course, disabled him greatly, but he kept up courage and after his injury had healed engaged in threshing again. In 1902 he bought his father’s farm, and kept up both farming and threshing until 1905, when he gave all of his attention to farming. Just after this a storm destroyed many of the buildings on his place and he rebuilt them better than they were before and made several additions. He now owns 320 acres of land, seventy of which he plants in corn each year. In 1910 he retired from active work on the farm, and his son-in-law, Will Graham, now has actual charge of the place. Mr. Wolf has been twice married, his first wife being Mary Walsh, a native of Germany, to whom he was married in 1890. No children were born to them and the wife died in 1912. Mr. Wolf later married Dorothea Hoffman, who was born in Atchison county, April 15, 1870, and is the daughter of Frederick and Katharena (Scheu) Hoffman. Her parents are of German birth, both having left their native country when quite young. They were married in Illinois and came to Kansas about 1860, where nine children were born to them. Three had been born to them while they were living in Illinois. The father engaged in farming in Center township and worked the place
  • 72.
    which Frank Hubbardnow farms and was also a blacksmith in Atchison, Kan., for a few years. He died in July, 1887, at the age of fifty-six years. No children were born to Mr. and Mrs. Wolf, and the wife died in July, 1913, at the age of seventy-six years. Mr. Wolf is a Republican. He is a member of the Fraternal Order of Eagles and belongs to the Evangelical church. Mr. Wolf has striven under the greatest difficulties, having lost his right hand when a young man, he has been immeasurably handicapped through the greater part of his life. This is especially true in view of the fact that he followed farming, where, if anywhere, the use of both hands is necessary. Though it was a great disadvantage that Mr. Wolf was placed under, he made a success of his career by hard work and good management.
  • 73.
    FRANK J. WAGNER. FrankJ. Wagner, farmer and stockman, of Center township, Atchison county, was born July 16, 1864, in Austria. He is a son of Frank J. and Louise (Frennar) Wagner, and was one of seven children, four of whom are living. The parents were born in Austria and the father remained there until his death in 1870. He was a farmer and was seventy-eight years old when he died. In 1888 the mother left Austria and came to Atchison, Kan., where she is now living. She was married a second time and this husband is also dead. She will be seventy-six years old in August, 1916. Frank J. Wagner, the subject of this sketch, was educated in his native land and after attending the Austrian schools learned the trade of wagon maker. Until 1884 he worked at this trade in Austria. He then immigrated to America and came to Atchison, Kan., where he worked for a lumber company for some time. Three years later he went to work on a farm, and after five years he returned to Atchison and worked two years. He then rented land in Shannon township, Atchison county, and in 1905 bought 160 acres in Center township. He bought this place just in time to have his buildings torn to pieces by the storm of 1905. Most of the buildings were blown down by the wind and it was necessary to rebuild practically all of them. In doing this he made some $5,000 worth of improvements. Mr. Wagner takes a great deal of interest in the breeding of fine Poland China hogs. He was married to Amelia Wonder, March 5, 1890. She is a daughter of Wenzel and Amelia Wonder, and was born in Austria in August, 1873. She came to America with her mother in 1888, and later settled in Atchison county. Mr. and Mrs. Wagner are the parents of the following children: Frank, farming with his father; Karl, living with his father; Frances, married to M. Mudice; Ada, deceased: John, Albert and George, living at home. Mr. Wagner is an independent Democrat in politics. He is a member of the Catholic church and of the Fraternal Order of Eagles.
  • 74.
    WILLIAM WEHKING. William Wehking,farmer and stockman, of Center township, Atchison county, was born in Westphalia, Germany, November 26, 1866. He is a son of Christian and Christena (Ruhe) Wehking, who were the parents of seven children, one of whom is dead. The parents both died in their native land. William Wehking worked in a flour- mill in Germany until 1886, when he immigrated to America. He thought that the West offered the best opportunity to a poor boy, and came to Kansas, settling in Cummings, Atchison county. He began working on a farm at thirteen dollars a month. Eight years later he rented land near Nortonville, Kan. In 1894 he bought eighty acres in Jefferson county, Kansas, where he farmed eight years. Later, he sold this place and bought the farm of 150 acres which he now owns. He erected a fine silo on this place and is especially prepared to raise fine stock. He has since increased his holdings to 190 acres and has ventured into the dairy business fine Durham cattle and Poland China hogs in which he takes great pride. Mr. Wehking is a stockholder in a mercantile enterprise in Nortonville, Kan. In 1895 Mr. Wehking married Minnie (Giesking), who was born in Germany August 31, 1876. When sixteen years old she came to America and settled at Lancaster, Kan. Mr. and Mrs. Wehking have eight children: Martha, Edward, Clara, William, Alma, Ernst, Frederick and Henry, all living at home. Mr. Wehking is an independent voter and is a member of the Lutheran church. He is a shrewd business man and has been successful primarily because of his conservative judgment in handling his business ventures.
  • 75.
    WILLIAM HARTMAN. William Hartman,prosperous farmer, of Mt. Pleasant township, Atchison county, was born in Platte county, Missouri, in 1851, a son of Jonathan and Christina (Wolking) Hartman, the latter a native of Hanover, Germany, and emigrated from her native land with her parents when ten years of age, locating in Cincinnati, Ohio. Jonathan Hartman was born in 1821, at Brookville, Franklin county, Indiana, and was a son of Henry Hartman, who was born in Pennsylvania, and was among the first settlers of Franklin county, Indiana. In 1842 Henry left Indiana and settled in Platte county, Missouri, and was among the early pioneers of that county. He died on his farm in Missouri in 1860. Jonathan, the father of William, was reared to young manhood in Indiana and was married there. In 1847, he with his wife and two children followed his father to Platte county, Missouri, and there followed his trade of millwright in Platte City until 1849, when he made the overland trip to California with ox teams, remaining on the coast for two years. He made some money while in the gold fields and returned home by way of Cape Horn, paying $500 for his passage. Captain Fulger was in command of the ship and he lost his vessel on the coast of Central America, the vessel striking the rocks and breaking in pieces. All aboard were rescued except the first mate. There were 500 passengers on this vessel who were compelled to wait on the west coast for five weeks before an opportunity presented itself to cross the mountains to the eastern shore. They were eventually taken across the mountains, but several died from the hardships they endured during the trip. Mr. Hartman secured passage to New Orleans, and from that city came up the Mississippi river to St. Louis, arriving there in December of 1850. From St. Louis the returned argonaut went to his home at Platte City. Three years later he set out with five wagons in partnership with his brother-in-law, R. D. Johnson, en route to Salt Lake City, Utah. The wagons were heavily loaded with provisions, drygoods and liquor. When the expedition arrived at the south fork of Green river they left three wagonloads at that point and pressed onward to their destination to the north fork of the river. They traded with the
  • 76.
    Indians and Mormonsand made considerable money. Prices were fabulous in the far West in those days, flour bringing $100 per hundred weight; common work shirts sold for five dollars each, whiskey brought five dollars per pint, and the prices of other commodities were in proportion. Returning home from this trip Mr. Hartman lived in Platte City until 1854, and then came to Kansas with the first steam sawmill ever erected in Atchison county, and one of the first to be placed in operation in Kansas. He established his mill at old Port William and operated it successfully until 1857. He then came to Mt. Pleasant township and preëmpted a claim now known as the Howe farm which he sold for fifty dollars. He traded his sawmill for a farm near Parnell, Kan., now owned by Robert Volk. Jonathan was personally acquainted with Pardee Butler, and met and conversed with Butler after he had been set adrift on a raft on the Missouri river by pro-slavery men. He took Butler to his home and gave him his supper. He hid the refugee at the home of a neighbor until the next day and then accompanied him to Weston, from which point Mr. Butler made his way to his old home in Ohio, where he remained in safety for nine months before he returned to Kansas. Jonathan Hartman was a Free State man and a Republican in politics, who took a prominent and influential part in the affairs of his locality. He was appointed guardian for the war widows and was selected by the Civil war veterans of the county to distribute the money apportioned to the war widows. On account of defective hearing, contracted as a result of an attack of mountain fever, he was not eligible for service in the Union army, but lent his moral support to the Union. He died on the farm January 24, 1897. He was the father of nine children, three of whom are living, as follows: R. D. Hartman, born in Missouri in 1847; William Hartman, the subject of this review; and Henry Hartman, born in Indiana; Frederick Hartman, former sheriff of the county; Elijah Hartman, born in Atchison county, Kansas, in 1856, and died in 1890; Alice, wife of E. N. Eshom, of Atchison county. William Hartman grew up on his father’s farm and was educated in the district school of his neighborhood. He was married in 1883 to Florence A. Good, a daughter of Daniel Good, an early settler of Atchison county, and originally from New York State. Mr. Hartman is the owner of 140 acres of very fine and productive land near old Parnell. The children of William and Florence Hartman are as
  • 77.
    follows: Morris, JonathanH., Nelson, Mariwillie, wife of H. W. Gilbert, of Horton, Kan.; and Flossie, wife of J. C. Cartmille, of Atchison county; Warren, the youngest of the family, was born November 11, 1901. Mr. Hartman is a stanch Republican in politics, is a member of the Christian church, and is affiliated with the Independent Order of Odd Fellows.
  • 78.
    ROYAL BALDWIN. Near theold village of Kennekuk, in the northeast corner of Grasshopper township, Atchison county, Kansas, stands the old home of Maj. Royal Baldwin, Indian agent. This home was built sixty years ago by Major Baldwin and is at present the home of Mrs. Jennie L. Dollinds, the last of the race of Baldwins in Atchison county. This narrative, therefore, will deal principally with the life career of Royal Baldwin, United States Indian agent, who was widely known in all of northeast Kansas as Major Baldwin. Royal Baldwin was born in Litchfield, Conn., June 22, 1817, and was a descendant of ancestors who came over from England in the Mayflower. Three brothers, Ira, Julius, and Thomas, landed at Plymouth Rock with the party of Pilgrims who sought homes in the forbidding wilderness of New England in 1620. Julius Baldwin was the founder of the family of which Royal Baldwin descended, and he finally settled in Connecticut, where Royal was born and reared to young manhood. Royal Baldwin received a good education in the public schools and academy of his neighborhood in Connecticut, and when fifteen years of age he began teaching school. Later, the spirit of adventure moved him and he went to Ohio, where he became a boatman on the Muskingum river. While living in Ohio he married Miss Ann Campbell, who was born February 15, 1820, in Belmont county, Ohio, and died July 16, 1894. She was a daughter of Joseph Campbell, of Scotch parents, and who married a lady of Welsh parentage. After his marriage Royal Baldwin settled in Meigs county, Ohio, where their three children were born. In 1856 Mr. Baldwin was appointed Indian agent by the United States Government and sent to northeast Kansas to take charge of the moving of the four tribes, the Kickapoos, Sacs, Foxes and Pottawatomies to their Kansas reservations. When he received his appointment he removed with his family overland to St. Joseph, Mo., and immediately began his duties of settling the Indians on their reservations. He remained as Indian agent for twelve years and then resigned his position on account of poor health, but was again appointed and held the office for three years, after which he resigned, but was re-appointed by the
  • 79.
    Welcome to ourwebsite – the perfect destination for book lovers and knowledge seekers. We believe that every book holds a new world, offering opportunities for learning, discovery, and personal growth. That’s why we are dedicated to bringing you a diverse collection of books, ranging from classic literature and specialized publications to self-development guides and children's books. More than just a book-buying platform, we strive to be a bridge connecting you with timeless cultural and intellectual values. With an elegant, user-friendly interface and a smart search system, you can quickly find the books that best suit your interests. Additionally, our special promotions and home delivery services help you save time and fully enjoy the joy of reading. Join us on a journey of knowledge exploration, passion nurturing, and personal growth every day! ebookbell.com