Steps:
1.Create the “index.html” file in the WebRoot foldder.
2.Create “js” foldder in the WebRoot ,and then add “jquery” file.
3.Create the package of “controller”,and then create “AjaxController.java” Servlet including “doGet()” and “doPost()” methods.
4.Deploy the “web.xml”:
like:
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
5.Edit your “index.html”:
(1)add < title >
(2)add < script >
(3)add < body >