Chapter 3. Adding Dynamic Visuals to a Web Application
In this chapter, we will learn how to create servlets returning JSON data followed by understanding the concepts of jQuery AJAX and promising and templating a library to render data in our page. In the later section of this chapter, we will learn how to create a carousel for the hero section.
Building a JSON servlet
In this section, we will develop a Java servlet that will return a list of products as a JSON array. Before building the servlet, we need to create a Java class named
Product. This class is known as a Plain Old Java Object (POJO) as it does not implement any interface or extend any other classes. This class will have many different properties that we are going to use to store the ...