Book Image

Developing Responsive Web Applications with AJAX and jQuery

By : Sandeep Kumar Patel
Book Image

Developing Responsive Web Applications with AJAX and jQuery

By: Sandeep Kumar Patel

Overview of this book

<p>AJAX is a web development technique that allows a web page to be updated with new information without having to reload the page. jQuery is a JavaScript library that harnesses AJAX interactions to allow rapid web development. Together, they are a powerful combination, and are generally considered by frontend web developers as technologies that complement each other perfectly.</p> <p>Developing Responsive Web Applications with AJAX and jQuery will empower you with the skills required to create responsive web applications in a quick and efficient manner. The book begins by identifying the key benefits of a responsive application for a commercial site, and then covers how to develop a layout using Bootstrap 3 and adding dynamic visuals to your web application using AJAX calls.</p> <p>By the end of this book, you will be able to develop responsive web applications by combining AJAX development techniques with the jQuery JavaScript library.</p>
Table of Contents (17 chapters)
Developing Responsive Web Applications with AJAX and jQuery
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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 corresponding values.

Creating a POJO class

The value object of the Product class has all properties related to a product. The different fields of a product are:

  • Title: This field contains the title of the product and is of the type string. The getTitle() and setTitle() methods are two getter and setter methods.

  • Cost: This field contains the pricing of the product and is of the type integer. The getCost() and setCost() methods are two getter and setter methods.

  • Description: This field contains the information about the product and is of the type string. The getDescription() and setDescription...