In this section, we shall create a servlet to process the AJAX request and send a server response. A servlet represents the Controller facet of the Model View Controller (MVC) design pattern; the JSP page represents the View facet. Go to File | New | Other and in the New wizard, expand Web and select Servlet. Click on Next as shown in the following screenshot:
In Create Servlet,
select the project EclipseAjax in which you want to create a servlet, select the Source folder as
/EclipseAjax/src, specify a Java package name as
ajax.servlet and a Class name as FormServlet. A servlet extends the
javax.servlet.http.HttpServlet class. ...