Learning Path: Spring and Spring Boot Projects

Course

Online

£ 40 + VAT

Description

  • Type

    Course

  • Methodology

    Online

  • Start date

    Different dates available

Trying to build a highly robust application usually drifts the focus on infrastructure than functionality. Spring MVC and Spring Boot are the light-weight framework that comes to the rescue. This course will get you started with creating, deploying, and running a Spring MVC project using the Spring Tool Suite and will move on to building a Spring Boot application. At the end of the course, you will even get a glimpse of Spring security.About the AuthorKoushik KothagalKoushik Kothagal is the founder of Java Brains, an online training website that offers courses on various enterprise Java and JavaScript technologies entirely for free. He works as a Senior Staff Engineer at Financial Engines. He has over 14 years of professional experience working on full-stack web applications and has worked extensively with technologies such as Java, Spring, Java EE, JavaScript, and Angular. He loves teaching, and when he's not coding Java and JavaScript, he's probably teaching it! He currently lives in the Bay Area.Greg L. TurnquistGreg L. Turnquist has been a software professional since 1997. In 2002, he joined the senior software team that worked on Harris' $3.5 billion FAA telco program, architecting mission-critical enterprise apps while managing a software team. He provided after-hours support to a nation-wide system and is no stranger to midnight failures and software triages. In 2010, he joined the SpringSource division of VMware, which was spun off into Pivotal in 2013.As a test-bitten script junky, Java geek, and JavaScript Padawan, he is a member of the Spring Data team and the lead for Spring Session MongoDB. He has made key contributions to Spring Boot, Spring HATEOAS, and Spring Data REST while also serving as editor-at-large for Spring's Getting Started Guides.
.
Greg wrote technical best sellers Python Testing Cookbook and Learning Spring Boot, First Edition, for Packt Publishing

Facilities

Location

Start date

Online

Start date

Different dates availableEnrolment now open

About this course

Create, deploy, and run a Spring MVC project using the Spring Tool Suite
Write new Spring MVC controllers and views
Develop an end-to-end interactive web application with forms, web pages, and CRUD functionality
Implement error handling and custom error pages in addition to adding locale support and themes
Create a login page and validation for user registration
Implement shopping cart and ordering functionality
Design a RESTful API and develop exception handling for REST web services.

Questions & Answers

Add your question

Our advisors and other users will be able to reply to you

Who would you like to address this question to?

Fill in your details to get a reply

We will only publish your name and question

Reviews

This centre's achievements

2021

All courses are up to date

The average rating is higher than 3.7

More than 50 reviews in the last 12 months

This centre has featured on Emagister for 4 years

Subjects

  • Team Training
  • Writing
  • Project
  • Web
  • Teaching
  • Database training
  • Database
  • Works
  • JSP
  • Javascript
  • HTML
  • Server
  • XML
  • Java
  • JSP training
  • Javascript training
  • XML training
  • Access

Course programme

Building Web Applications with Spring MVC 28 lectures 03:13:08 Setting Up the Development Environment We need an IDE and an application server to run the code that we will develop as we learn.
  • Downloading an IDE from springsource.org
  • Starting the tc server
  • Accessing the home page to verify that the server works
  • Setting up the development environment
Writing Our First Spring MVC Application We need to create a project to add code. After development, we need to be able to deploy and test our code.
  • Creating a new Spring MVC project
  • Deploying our project on the server
  • Accessing the test page to verify that the application is deployed
  • Writing our first Spring MVC application
Using the Startup Code To build effective Spring MVC apps, we need business services that connect to the database. We'll use some built-in business services to help us get started.
  • Creating a new Spring MVC project
  • Importing and building a sample code project
  • Adding dependencies for the imported project to the main pom.xml
  • Using the startup code
Understanding the Model We need to understand the methods and logic in the model artifact that we'll use for the Spring MVC project. We will also need to link it to the model's application context.
  • Understanding the classes and methods
  • Including the Spring application context XML in the root context
Calling the Model We need to be able to access the methods of the model from the controller layer, make calls, and return results.
  • Making a call to the business service from the controller
  • Saving the result in the model
  • Displaying the results on the JSP page by accessing the model map
Writing a Controller We need to write a new Spring MVC controller to map to a required URL and redirect to a JSP path.
  • Creating a new Controller class
  • Annotating the required mappings
  • Creating a JSP and redirecting it to the JSP path
Getting the User Input The chocolate store web application needs the functionality to have users register themselves. The model has methods to do this. We need to make this functionality available in the web application.
  • Creating an HTML form in the JSP page
  • Adding a new method in the controller and using RequestMapping to map to the form submit
  • Saving the object using business services and displaying a success message
Using Path Variables and Redirects Currently, in the application, when the user enters their information and clicks on Save, they see a success message, but there is no way for them to check if the save operation did indeed work fine. You will create a profile view page that the user can access to view their profile, and a save command will be redirected to this profile page instead of a success message page.
  • Creating a new controller method to get user data
  • Mapping path variables to get the user ID
  • Using redirect to redirect from one controller to another, instead of a JSP page
Implementing Validation You have implemented a user registration input form that lets users enter their data. But right now, you do not check if the input is valid data. What if the user enters an invalid e-mail or does not fill in some of the fields? To make sure that the user enters appropriate data, you will need to validate it after you receive it in the controller and before you save it to the database.
  • Adding validation annotations to the model class
  • Using the @Valid annotation to have Spring MVC perform validation and redirect the control back to the form in case of errors
  • Using Spring MVC's form and error tags to display error messages on the page
Adding the Update Functionality Now that you have let the user create new profiles by using the Register page, and also to view their profile on the View page, next, you’ll be providing them with the edit functionality.
  • Adding a controller method to fetch user information
  • Setting the user information as a model attribute and redirecting the user to the edit JSP
  • Wiring the form submit to a new controller method that merges the user's data
Working with Multiple Entities The Customer entity that you’ve used so far is what you'd call a “standalone” entity. You haven’t really had to worry about relationships between entities so far. We’ll now work with two entities that are related.
  • Creating controllers for loading forms
  • Adding calls to business services to get related entities to show as dropdowns for users to choose
  • Setting the related entities in the model and accessing them from the JSP using the Spring MVC select tags
Implementing Themes While we have made huge progress and have a web application on our hands that provides considerable functionality, it doesn’t look very good. We will incorporate some styles, and better still, let users choose the styles or themes they want.
  • Adding theme style sheets and referring to them from the header JSP
  • Using ThemeSource to build up a source of themes with unique names
  • Using ThemeChangeInterceptors and CookieThemeResolvers to enable users to change themes based on their preference
Implementing Internationalization Currently, the chocolate store web application doesn’t have a lot of options when it comes to languages. Everything is in English. If you'd like your application to be used by people across the globe, you’ll need to provide support for multiple languages.
  • Externalizing static text into property files
  • Adding Spring MVC's LocaleSource bean to build up locales
  • Using Spring MVC's message tags to dynamically look up property values in JSPs
Working with Model Objects In our chocolate store application, there is no way for users to browse for products that are sold on the web store. You'll add a category list display on the home page, and on the category page, and you'll show the products that belong to that category.
  • Adding a category list to the home page
  • Implementing the User ModelAndView construct to manage both the model and view
  • Using the @ModelAttribute annotation to fetch the required data to display the web pages
Understanding Data Binding You'll be creating a search form that lets users search for products based on a couple of search criteria.
  • Adding a search page with a search form
  • Creating a SearchController that handles search requests
  • Using controller method arguments with BindingResult to manage data binding
Writing Custom Validators We will define a couple of search restrictions and validate the user input.
  • Writing a custom Validator class
  • Adding the InitBinder method to bind the validator
  • Using the @Valid annotation to validate the method argument
Handling Exceptions The Spring chocolate store application has functionality to let users browse for products. However, if for some reason, a request fails, we should be able to provide a good experience to the user. A response in case of an error message should be a well-designed error page, with a brief description of the error and a way for the user to either retry or navigate back to the home page.
  • Implementing a method with @ExceptionHandler
  • Implementing HandlerExceptionResolver for GlobalExceptionHandler
  • Writing an error JSP page to display user-friendly error messages
Implementing the Login Functionality To enable purchases in the chocolate store application, you'll need to build the login functionality.
  • Creating a controller and a JSP to display a login form
  • Adding a controller method to handle authentication
  • Using the HTTPSession method parameter to persist the logged-in user's information in the session
Implementing the Shopping Cart Functionality We currently do not have a way for a user of the chocolate store application to shop for products and place an order. In this tutorial, you will implement a shopping cart feature that lets the users do this.
  • Building a Cart class with the session scope
  • Injecting the Cart instance into the Shopping cart controller
  • Adding products to the Cart instance when the user clicks on them
Implementing the Ordering Functionality You've implemented a shopping cart in the session in the previous tutorial. The user can add items to the cart, but there is no way to view the contents. In this tutorial, you'll implement a cart URL that displays the cart contents, and you will also implement a "Place order" button that lets them order the contents of the cart.
  • Building a view cart controller and a JSP page that displays information from the session-scoped cart bean
  • Building a "Place order" form and a controller to let users submit the order
  • Using flash variables to display messages after redirect
Writing Custom Interceptors The chocolate store application has a shopping cart functionality that's closely tied to the logged-in user. However, there's no way to stop an unauthenticated user from adding items to the cart and placing an order. In this video, you will write a SecurityInterceptor that allows only a logged-in user to access any functionality related to the shopping cart.
  • Writing an Interceptor class by implementing HandlerInterceptor
  • Configuring the interceptor in servlet context XML file and mapping URLs
  • Extending HandlerInterceptorAdapter to write only the methods you need
Integrating with Freemarker In this video, you will publish a URL that shows a list of products in the store, with the view generated not by a JSP but by a Freemarker FTL file.
  • Adding a FreemarkerViewResolver bean definition
  • Creating the FTL file
  • Creating a controller method that returns the FTL view
Integrating with Apache Tiles How can we add common elements to every page in our application? An easy way is to use a tiling framework such as Apache Tiles, which is what we will look at in this video.
  • Adding a tiles view resolver definition
  • Creating tiles XML and layout pages
  • Ordering the view resolver so that the tiles resolver is first in the chain
Working with Multiple Content Types Let's say we have a requirement to render product information on our website in various different formats. Right now, you can enter the URL products/product/productid to view the product information in HTML. However, let's say we need to make this information available to the user in XML and JSON formats. What would be the best way to implement a feature like this?
  • Building support for XML and JSON by writing view resolvers
  • Including the necessary dependencies and making changes to the entity to make them marshallable
  • Adding ContentnegotiatingViewResolver as the first view resolver in the chain
Understanding RESTful Web Services RESTful web services have gained in popularity over the years. It is widely considered by many to be an excellent alternative to the older SOAP web services specification. You'll implement a RESTful API for the Spring Chocolate store application.
  • Understanding the resource URIs and collection URIs
  • Understanding HTTP methods
  • Understanding the concept of HATEOAS
  • Understanding RESTful web services
Implementing Your First REST Endpoint In sections 2 and 3, we saw how to display the product catalog information to the user as HTML that they can read in their browsers. When publishing the same information as RESTful web services, there are a few different factors that you need to account for.
  • Returning a resource instance from the controller method
  • Using ResponseBody annotation to indicate that the instance must be converted to the response payload
  • Creating RestBean classes to customize the payload format
  • Implementing your first REST endpoint
Implementing CRUD APIs In the previous tutorial, you wrote the category REST controller that lets clients get category information. We'll now see how to implement product information as well as place an order using Spring MVC's REST support.
  • Using the HTTP methods GET, POST, PUT, and DELETE to map different CRUD methods
  • Using the RequestBody annotation to get payload from the request
  • Using the ResponseStatus annotation to configure the HTTP response code returned
  • Implementing CRUD APIs
Implementing Exception Handling and HATEOAS The REST APIs do not have error handling yet. If there is any error, we get the tc Server error page as the response. For REST APIs, it is important that we provide non-HTML payloads as the response for both success and error scenarios.
  • Using the ExceptionHandler annotation to map Controller methods that return the message payloads
  • Adding a resource link in the HTTP header by creating an API response
  • Using the HATEOAS library to build URIs by directly specifying Controllers
  • Implementing Exception handling and HATEOAS
Building Web Applications with Spring MVC. 28 lectures 03:13:08 Setting Up the Development Environment We need an IDE and an application server to run the code that we will develop as we learn.
  • Downloading an IDE from springsource.org
  • Starting the tc server
  • Accessing the home page to verify that the server works
  • Setting up the development environment
Writing Our First Spring MVC Application We need to create a project to add code. After development, we need to be able to deploy and test our code.
  • Creating a new Spring MVC project
  • Deploying our project on the server
  • Accessing the test page to verify that the application is deployed
  • Writing our first Spring MVC application
Using the Startup Code To build effective Spring MVC apps, we need business services that connect to the database. We'll use some built-in business services to help us get started.
  • Creating a new Spring MVC project
  • Importing and building a sample code project
  • Adding dependencies for the imported project to the main pom.xml
  • Using the startup code
Understanding the Model We need to understand the methods and logic in the model artifact that we'll use for the Spring MVC project. We will also need to link it to the model's application context.
  • Understanding the classes and methods
  • Including the Spring application context XML in the root context
Calling the Model We need to be able to access the methods of the model from the controller layer, make calls, and return results.
  • Making a call to the business service from the controller
  • Saving the result in the model
  • Displaying the results on the JSP page by accessing the model map
Writing a Controller We need to write a new Spring MVC controller to map to a required URL and redirect to a JSP path.
  • Creating a new Controller class
  • Annotating the required mappings
  • Creating a JSP and redirecting it to the JSP path
Getting the User Input The chocolate store web application needs the functionality to have users register themselves. The model has methods to do this. We need to make this functionality available in the web application /p Writing Our First Spring MVC Application We need to create a project to add code. After...

Additional information

Core understanding of Java

Learning Path: Spring and Spring Boot Projects

£ 40 + VAT