Spring Cookbook
eBook - ePub

Spring Cookbook

  1. 234 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Spring Cookbook

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription.
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn more here.
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, we’ve got you covered! Learn more here.
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Yes! You can use the Perlego app on both iOS or Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app.
Yes, you can access Spring Cookbook by Jerome Jaglale in PDF and/or ePUB format, as well as other popular books in Computer Science & Databases. We have over one million books available in our catalogue for you to explore.

Information

Spring Cookbook


Table of Contents

Spring Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why Subscribe?
Free Access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Sections
Getting ready
How to do it…
How it works…
There's more…
See also
Conventions
Reader feedback
Customer support
Downloading the example code
Errata
Piracy
Questions
1. Creating a Spring Application
Introduction
Installing Java, Maven, Tomcat, and Eclipse on Mac OS
How to do it…
Installing Java
Installing Maven
Installing Tomcat
Installing Eclipse
There's more…
Installing Java, Maven, Tomcat, and Eclipse on Ubuntu
How to do it…
Installing Java
Installing Maven
Installing Tomcat
Installing Eclipse
There's more…
Installing Java, Maven, Tomcat, and Eclipse on Windows
How to do it…
Installing Java
Installing Maven
Installing Tomcat
Installing Eclipse
Creating a Spring web application
How to do it…
Creating a new Maven project in Eclipse
Adding Spring to the project using Maven
Creating the configuration classes for Spring
Creating a "Hello World" web page
How it works…
Creating a new Maven project in Eclipse
Adding Spring to the project using Maven
Creating the configuration classes for Spring
Creating a "Hello World" web page
Running a Spring web application
How to do it…
How it works…
There's more…
Using Spring in a standard Java application
How to do it…
Creating a new Maven project in Eclipse
Adding Spring to the project using Maven
Creating a configuration class for Spring
Creating the User class
Defining a User singleton in the Spring configuration class
Using the User singleton in the main() method
How it works...
2. Defining Beans and Using Dependency Injection
Introduction
Defining a bean explicitly with @Bean
How to do it…
How it works…
There's more…
Defining a bean implicitly with @Component
Getting ready
How to do it…
How it works…
There's more…
Using a bean via dependency injection with @Autowired
Getting ready
How to do it…
How it works…
There's more…
Using a bean directly
Getting ready
How to do it…
How it works…
There's more…
Listing all beans
Getting ready
How to do it…
How it works…
There's more…
Using multiple configuration classes
Getting ready
How to do it…
There's more…
3. Using Controllers and Views
Introduction
Associating a route to a controller method
How to do it…
How it works…
Using a JSP view
How to do it…
How it works…
There's more…
Passing attributes from a controller to a JSP view
How to do it…
How it works…
Using dynamic route parameters in a controller method
How to do it…
How it works…
Using a common prefix for the routes of a controller
How to do it…
How it works…
Using a page template with Tiles
How to do it…
How it works…
There's more…
Organizing the JSP with subfolders
Using multiple page templates
Defining page titles only once using a text attribute
Executing some code before and after controllers using interceptors
How to do it…
How it works…
There's more…
Building multilingual pages
How to do it…
How it works…
There's more…
Getting the current language
Using the language in the URL
4. Querying a Database
Introduction
Connecting to a database
Getting ready
How to do it…
How it works…
Creating a DAO class
How to do it…
How it works…
Calling a DAO method from a controller class
Getting ready
How to do it…
How it works…
Saving an object
Getting ready
How to do it…
How it works…
Retrieving an object
How to do it…
How it works…
There's more…
Retrieving a list of objects
How to do it…
How it works…
Retrieving a list of objects with their dependencies
Getting ready
How to do it…
How it works…
Updating an object
How to do it…
There's more…
Deleting an object
How to do it…
Finding the number of results for an SQL query
How to do it…
Saving a list of objects at once
How to do it…
How it works…
Reverting incomplete database modifications using transactions
How to do it…
How it works…
Using Hibernate for powerful object persistence and querying
Getting ready
How to do it…
5. Using Forms
Introduction
Displaying...

Table of contents

  1. Spring Cookbook