{"id":2737,"date":"2022-12-20T15:35:21","date_gmt":"2022-12-20T07:35:21","guid":{"rendered":"https:\/\/qaqaq.top\/?p=2737"},"modified":"2022-12-20T15:35:22","modified_gmt":"2022-12-20T07:35:22","slug":"ajax%e5%8a%9f%e8%83%bd%e6%bc%94%e7%a4%ba","status":"publish","type":"post","link":"https:\/\/qaqaq.top\/?p=2737","title":{"rendered":"AJAX\u529f\u80fd\u6f14\u793a"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">AJAX-\u4ec0\u4e48\u662fAJAX\u8bf7\u6c42<\/h2>\n\n\n\n<p>AJAX \u5373\u201cAsynchronous Javascript And XML\u201d\uff08\u5f02\u6b65 JavaScript \u548c XML\uff09\uff0c\u662f\u6307\u4e00\u79cd\u521b\u5efa\u4ea4\u4e92\u5f0f\u7f51\u9875\u5e94\u7528\u7684\u7f51\u9875\u5f00\u53d1\u6280\u672f\u3002<\/p>\n\n\n\n<p>ajax \u662f\u4e00\u79cd\u6d4f\u89c8\u5668\u901a\u8fc7 js \u5f02\u6b65\u53d1\u8d77\u8bf7\u6c42\uff0c\u5c40\u90e8\u66f4\u65b0\u9875\u9762\u7684\u6280\u672f\u3002<\/p>\n\n\n\n<p>Ajax \u8bf7\u6c42\u7684\u5c40\u90e8\u66f4\u65b0\uff0c\u6d4f\u89c8\u5668\u5730\u5740\u680f\u4e0d\u4f1a\u53d1\u751f\u53d8\u5316<br>\u5c40\u90e8\u66f4\u65b0\u4e0d\u4f1a\u820d\u5f03\u539f\u6765\u9875\u9762\u7684\u5185\u5bb9<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">AJAX-\u539f\u751fJavaScript\u7684AJAX\u8bf7\u6c42\u793a\u4f8b\u3001AJAX-AJAX\u8bf7\u6c42\u7684\u7279\u70b9\u8bf4\u660e<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.01 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/html4\/loose.dtd\">\r\n&lt;html>\r\n\t&lt;head>\r\n\t\t&lt;meta http-equiv=\"pragma\" content=\"no-cache\" \/>\r\n\t\t&lt;meta http-equiv=\"cache-control\" content=\"no-cache\" \/>\r\n\t\t&lt;meta http-equiv=\"Expires\" content=\"0\" \/>\r\n\t\t&lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=UTF-8\">\r\n\t\t&lt;title>Insert title here&lt;\/title>\r\n\t\t&lt;script type=\"text\/javascript\">\r\n\t\t\t\/\/\u5728\u8fd9\u91cc\u4f7f\u7528javaScript\u8bed\u8a00\u53d1\u8d77Ajax\u8bf7\u6c42\uff0c\u8bbf\u95ee\u670d\u52a1\u5668AjaxServlet\u4e2djavaScriptAjax\r\n\t\t\tfunction ajaxRequest() {\r\n\/\/ \t\t\t\t1\u3001\u6211\u4eec\u9996\u5148\u8981\u521b\u5efaXMLHttpRequest\r\n\t\t\t\tvar xmlhttprequest = new XMLHttpRequest();\r\n\/\/ \t\t\t\t2\u3001\u8c03\u7528open\u65b9\u6cd5\u8bbe\u7f6e\u8bf7\u6c42\u53c2\u6570\r\n\t\t\t\txmlhttprequest.open(\"GET\",\"http:\/\/localhost:8080\/JavaWeb_Code_AJAX\/ajaxServlet?action=javaScriptAjax\",true);\r\n\/\/ \t\t\t\t4\u3001\u5728send\u65b9\u6cd5\u524d\u7ed1\u5b9aonreadystatechange\u4e8b\u4ef6\uff0c\u5904\u7406\u8bf7\u6c42\u5b8c\u6210\u540e\u7684\u64cd\u4f5c\u3002\r\n\t\t\t\txmlhttprequest.onreadystatechange = function () {\r\n\t\t\t\t\tif (xmlhttprequest.readyState == 4 &amp;&amp; xmlhttprequest.status == 200) {\r\n\r\n\t\t\t\t\t\talert(\"\u6536\u5230\u670d\u52a1\u5668\u8fd4\u56de\u7684\u6570\u636e\uff1a\" + xmlhttprequest.responseText);\r\n\r\n\t\t\t\t\t\tvar jsonObj = JSON.parse(xmlhttprequest.responseText);\r\n\r\n\r\n\t\t\t\t\t\t\/\/ \u628a\u54cd\u5e94\u7684\u6570\u636e\u663e\u793a\u5728\u9875\u9762\u4e0a\r\n\t\t\t\t\t\tdocument.getElementById(\"div01\").innerHTML = \"\u7f16\u53f7\uff1a\" + jsonObj.id + \",\u59d3\u540d\" + jsonObj.name;\r\n\r\n\t\t\t\t\t\t\/\/alert(xmlhttprequest.responseText);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\/\/ \t\t\t\t3\u3001\u8c03\u7528send\u65b9\u6cd5\u53d1\u9001\u8bf7\u6c42\r\n\t\t\t\txmlhttprequest.send();\r\n\r\n\t\t\t\talert(\"\u6211\u662f\u6700\u540e\u4e00\u884c\u4ee3\u7801\");\r\n\t\t\t}\r\n\t\t&lt;\/script>\r\n\t&lt;\/head>\r\n\t&lt;body>\r\n\t\t&lt;a href=\"http:\/\/localhost:8080\/JavaWeb_Code_AJAX\/ajaxServlet?action=javaScriptAjax\">\u975eAjax&lt;\/a> &lt;br\/>\r\n\t\t&lt;button onclick=\"ajaxRequest()\">ajax request&lt;\/button>\r\n\t\t&lt;div id=\"div01\">\r\n\t\t&lt;\/div>\r\n\t\t&lt;table border=\"1\">\r\n\t\t\t&lt;tr>\r\n\t\t\t\t&lt;td>1.1&lt;\/td>\r\n\t\t\t\t&lt;td>1.2&lt;\/td>\r\n\t\t\t&lt;\/tr>\r\n\t\t\t&lt;tr>\r\n\t\t\t\t&lt;td>2.1&lt;\/td>\r\n\t\t\t\t&lt;td>2.2&lt;\/td>\r\n\t\t\t&lt;\/tr>\r\n\t\t&lt;\/table>\r\n\t&lt;\/body>\r\n&lt;\/html><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">AJAX-jQuery\u7684ajax\u65b9\u6cd5\u3001AJAX-jQuery\u7684get\u548cpost\u65b9\u6cd5\u3001AJAX-jQuery\u7684getJSON\u65b9\u6cd5\u3001AJAX-jQuery\u7684serialize\u65b9\u6cd5<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD HTML 4.01 Transitional\/\/EN\" \"http:\/\/www.w3.org\/TR\/html4\/loose.dtd\">\r\n&lt;html>\r\n\t&lt;head>\r\n\t\t&lt;meta http-equiv=\"pragma\" content=\"no-cache\" \/>\r\n\t\t&lt;meta http-equiv=\"cache-control\" content=\"no-cache\" \/>\r\n\t\t&lt;meta http-equiv=\"Expires\" content=\"0\" \/>\r\n\t\t&lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=UTF-8\">\r\n\t\t&lt;title>Insert title here&lt;\/title>\r\n\t\t&lt;script type=\"text\/javascript\" src=\"script\/jquery-1.7.2.js\">&lt;\/script>\r\n\t\t&lt;script type=\"text\/javascript\">\r\n\t\t\t$(function(){\r\n\t\t\t\t\/\/ ajax\u8bf7\u6c42\r\n\t\t\t\t$(\"#ajaxBtn\").click(function(){\r\n\r\n\t\t\t\t\t$.ajax({\r\n\t\t\t\t\t\turl:\"http:\/\/localhost:8080\/JavaWeb_Code_AJAX\/ajaxServlet\",\r\n\t\t\t\t\t\t\/\/data:\"action=jQueryAjax\",\r\n\t\t\t\t\t\tdata:{action:\"jQueryAjax\"},\r\n\t\t\t\t\t\ttype:\"GET\",\r\n\t\t\t\t\t\tsuccess:function (data) {\r\n\t\t\t\t\t\t\t\/\/alert(\"\u670d\u52a1\u5668\u8fd4\u56de\u7684\u6570\u636e\u662f\uff1a\" + data);\r\n\r\n\t\t\t\t\t\t\t\/\/var jsonObj = JSON.parse(data);\r\n\r\n\t\t\t\t\t\t\t$(\"#msg\").html(\"ajax \u7f16\u53f7\uff1a\" + data.id + \",\u59d3\u540d\uff1a\" + data.name);\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tdataType: \"json\"\r\n\t\t\t\t\t})\r\n\t\t\t\t\t\r\n\t\t\t\t\t\/\/alert(\"ajax btn\");\r\n\r\n\t\t\t\t});\r\n\r\n\t\t\t\t\/\/ ajax--get\u8bf7\u6c42\r\n\t\t\t\t$(\"#getBtn\").click(function(){\r\n\r\n\t\t\t\t\t$.get(\"http:\/\/localhost:8080\/JavaWeb_Code_AJAX\/ajaxServlet\",\r\n\t\t\t\t\t\t\t\"action=jQueryGet\",\r\n\t\t\t\t\t\t\tfunction (data) {\r\n\t\t\t\t\t\t\t\t$(\"#msg\").html(\"get \u7f16\u53f7\uff1a\" + data.id + \",\u59d3\u540d\uff1a\" + data.name);\r\n\t\t\t\t\t\t\t},\"json\");\r\n\r\n\t\t\t\t\t\/\/alert(\" get btn \");\r\n\t\t\t\t\t\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t\t\/\/ ajax--post\u8bf7\u6c42\r\n\t\t\t\t$(\"#postBtn\").click(function(){\r\n\t\t\t\t\t\/\/ post\u8bf7\u6c42\r\n\t\t\t\t\t$.post(\"http:\/\/localhost:8080\/JavaWeb_Code_AJAX\/ajaxServlet\",\r\n\t\t\t\t\t\t\t\"action=jQueryPost\",\r\n\t\t\t\t\t\t\tfunction (data) {\r\n\t\t\t\t\t\t\t\t$(\"#msg\").html(\"post \u7f16\u53f7\uff1a\" + data.id + \",\u59d3\u540d\uff1a\" + data.name);\r\n\t\t\t\t\t\t\t},\"json\");\r\n\r\n\t\t\t\t\t\/\/alert(\"post btn\");\r\n\t\t\t\t\t\r\n\t\t\t\t});\r\n\r\n\t\t\t\t\/\/ ajax--getJson\u8bf7\u6c42\r\n\t\t\t\t$(\"#getJSONBtn\").click(function(){\r\n\t\t\t\t\t\/\/ \u8c03\u7528\r\n\t\t\t\t\t$.getJSON(\"http:\/\/localhost:8080\/JavaWeb_Code_AJAX\/ajaxServlet\",\r\n\t\t\t\t\t\t\t\"action=jQueryGetJSON\",\r\n\t\t\t\t\t\t\tfunction (data) {\r\n\t\t\t\t\t\t\t\t$(\"#msg\").html(\"getJSON \u7f16\u53f7\uff1a\" + data.id + \",\u59d3\u540d\uff1a\" + data.name);\r\n\t\t\t\t\t\t\t})\r\n\r\n\t\t\t\t\t\/\/alert(\"getJSON btn\");\r\n\r\n\t\t\t\t});\r\n\r\n\t\t\t\t\/\/ ajax\u8bf7\u6c42\r\n\t\t\t\t$(\"#submit\").click(function(){\r\n\t\t\t\t\t\/\/ \u628a\u53c2\u6570\u5e8f\u5217\u5316\r\n\r\n\t\t\t\t\t\/\/alert($(\"#form01\").serialize());\r\n\r\n\t\t\t\t\t$.getJSON(\"http:\/\/localhost:8080\/JavaWeb_Code_AJAX\/ajaxServlet\",\r\n\t\t\t\t\t\t\t\"action=jQuerySerialize&amp;\" + $(\"#form01\").serialize(),\r\n\t\t\t\t\t\t\tfunction (data) {\r\n\t\t\t\t\t\t\t\t$(\"#msg\").html(\"Serialize \u7f16\u53f7\uff1a\" + data.id + \",\u59d3\u540d\uff1a\" + data.name);\r\n\t\t\t\t\t\t\t})\r\n\r\n\t\t\t\t\t\/\/alert(\"serialize()\");\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t});\r\n\t\t&lt;\/script>\r\n\t&lt;\/head>\r\n\t&lt;body>\r\n\t\t&lt;div>\r\n\t\t\t&lt;button id=\"ajaxBtn\">$.ajax\u8bf7\u6c42&lt;\/button>\r\n\t\t\t&lt;button id=\"getBtn\">$.get\u8bf7\u6c42&lt;\/button>\r\n\t\t\t&lt;button id=\"postBtn\">$.post\u8bf7\u6c42&lt;\/button>\r\n\t\t\t&lt;button id=\"getJSONBtn\">$.getJSON\u8bf7\u6c42&lt;\/button>\r\n\t\t&lt;\/div>\r\n\t\t&lt;div id=\"msg\">\r\n\r\n\t\t&lt;\/div>\r\n\t\t&lt;br\/>&lt;br\/>\r\n\t\t&lt;form id=\"form01\" >\r\n\t\t\t\u7528\u6237\u540d\uff1a&lt;input name=\"username\" type=\"text\" \/>&lt;br\/>\r\n\t\t\t\u5bc6\u7801\uff1a&lt;input name=\"password\" type=\"password\" \/>&lt;br\/>\r\n\t\t\t\u4e0b\u62c9\u5355\u9009\uff1a&lt;select name=\"single\">\r\n\t\t\t  \t&lt;option value=\"Single\">Single&lt;\/option>\r\n\t\t\t  \t&lt;option value=\"Single2\">Single2&lt;\/option>\r\n\t\t\t&lt;\/select>&lt;br\/>\r\n\t\t  \t\u4e0b\u62c9\u591a\u9009\uff1a\r\n\t\t  \t&lt;select name=\"multiple\" multiple=\"multiple\">\r\n\t\t    \t&lt;option selected=\"selected\" value=\"Multiple\">Multiple&lt;\/option>\r\n\t\t    \t&lt;option value=\"Multiple2\">Multiple2&lt;\/option>\r\n\t\t    \t&lt;option selected=\"selected\" value=\"Multiple3\">Multiple3&lt;\/option>\r\n\t\t  \t&lt;\/select>&lt;br\/>\r\n\t\t  \t\u590d\u9009\uff1a\r\n\t\t \t&lt;input type=\"checkbox\" name=\"check\" value=\"check1\"\/> check1\r\n\t\t \t&lt;input type=\"checkbox\" name=\"check\" value=\"check2\" checked=\"checked\"\/> check2&lt;br\/>\r\n\t\t \t\u5355\u9009\uff1a\r\n\t\t \t&lt;input type=\"radio\" name=\"radio\" value=\"radio1\" checked=\"checked\"\/> radio1\r\n\t\t \t&lt;input type=\"radio\" name=\"radio\" value=\"radio2\"\/> radio2&lt;br\/>\r\n\t\t&lt;\/form>\t\t\t\r\n\t\t&lt;button id=\"submit\">\u63d0\u4ea4--serialize()&lt;\/button>\r\n\t&lt;\/body>\r\n&lt;\/html><\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Servlet<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>package top.qaqaq.servlet;\r\n\r\nimport com.google.gson.Gson;\r\nimport jakarta.servlet.ServletException;\r\nimport jakarta.servlet.http.HttpServletRequest;\r\nimport jakarta.servlet.http.HttpServletResponse;\r\nimport top.qaqaq.pojo.Person;\r\n\r\nimport java.io.IOException;\r\n\r\n\/**\r\n * @author RichieZhang\r\n * @create 2022-12-20 12:58\r\n *\/\r\npublic class AjaxServlet extends BaseServlet{\r\n\r\n    protected void javaScriptAjax(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\r\n        System.out.println(\"Ajax\u8bf7\u6c42\u8fc7\u6765\u4e86\");\r\n\r\n        Person person = new Person(1, \"\u6211\");\r\n\r\n        try {\r\n            Thread.sleep(3000);\r\n        } catch (InterruptedException e) {\r\n            e.printStackTrace();\r\n        }\r\n\r\n        \/\/json \u683c\u5f0f\u7684\u5b57\u7b26\u4e32\r\n        Gson gson = new Gson();\r\n        String personJsonString = gson.toJson(person);\r\n\r\n        resp.getWriter().write(personJsonString);\r\n    }\r\n\r\n    protected void jQueryAjax(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\r\n        System.out.println(\"jQueryAjax == \u65b9\u6cd5\u8c03\u7528\u4e86\");\r\n\r\n        Person person = new Person(1, \"\u6211\");\r\n\r\n        \/\/json \u683c\u5f0f\u7684\u5b57\u7b26\u4e32\r\n        Gson gson = new Gson();\r\n        String personJsonString = gson.toJson(person);\r\n\r\n        resp.getWriter().write(personJsonString);\r\n    }\r\n\r\n    protected void jQueryGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\r\n        System.out.println(\"jQueryGet == \u65b9\u6cd5\u8c03\u7528\u4e86\");\r\n\r\n        Person person = new Person(1, \"\u6211\");\r\n\r\n        \/\/json \u683c\u5f0f\u7684\u5b57\u7b26\u4e32\r\n        Gson gson = new Gson();\r\n        String personJsonString = gson.toJson(person);\r\n\r\n        resp.getWriter().write(personJsonString);\r\n    }\r\n\r\n    protected void jQueryPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\r\n        System.out.println(\"jQueryPost == \u65b9\u6cd5\u8c03\u7528\u4e86\");\r\n\r\n        Person person = new Person(1, \"\u6211\");\r\n\r\n        \/\/json \u683c\u5f0f\u7684\u5b57\u7b26\u4e32\r\n        Gson gson = new Gson();\r\n        String personJsonString = gson.toJson(person);\r\n\r\n        resp.getWriter().write(personJsonString);\r\n    }\r\n\r\n    protected void jQueryGetJSON(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\r\n        System.out.println(\"jQueryGetJSON == \u65b9\u6cd5\u8c03\u7528\u4e86\");\r\n\r\n        Person person = new Person(1, \"\u6211\");\r\n\r\n        \/\/json \u683c\u5f0f\u7684\u5b57\u7b26\u4e32\r\n        Gson gson = new Gson();\r\n        String personJsonString = gson.toJson(person);\r\n\r\n        resp.getWriter().write(personJsonString);\r\n    }\r\n\r\n    protected void jQuerySerialize(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\r\n        System.out.println(\"jQuerySerialize == \u65b9\u6cd5\u8c03\u7528\u4e86\");\r\n\r\n        System.out.println(\"\u7528\u6237\u540d\uff1a\" + req.getParameter(\"username\"));\r\n        System.out.println(\"\u5bc6\u7801\uff1a\" + req.getParameter(\"password\"));\r\n\r\n        Person person = new Person(1, \"\u6211\");\r\n\r\n        \/\/json \u683c\u5f0f\u7684\u5b57\u7b26\u4e32\r\n        Gson gson = new Gson();\r\n        String personJsonString = gson.toJson(person);\r\n\r\n        resp.getWriter().write(personJsonString);\r\n    }\r\n}\r\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>package top.qaqaq.servlet;\r\n\r\nimport jakarta.servlet.ServletException;\r\nimport jakarta.servlet.http.HttpServlet;\r\nimport jakarta.servlet.http.HttpServletRequest;\r\nimport jakarta.servlet.http.HttpServletResponse;\r\n\r\nimport java.io.IOException;\r\nimport java.lang.reflect.Method;\r\n\r\n\/**\r\n * @author RichieZhang\r\n * @create 2022-12-10 \u4e0b\u5348 12:28\r\n *\/\r\npublic abstract class BaseServlet extends HttpServlet {\r\n\r\n    @Override\r\n    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\r\n\r\n        doPost(req,resp);\r\n    }\r\n\r\n    @Override\r\n    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\r\n\r\n        \/\/ \u89e3\u51b3post\u8bf7\u6c42\u4e2d\u6587\u4e71\u7801\u95ee\u9898\r\n        \/\/ \u4e00\u5b9a\u8981\u5728\u83b7\u53d6\u8bf7\u6c42\u53c2\u6570\u4e4b\u524d\u8c03\u7528\u624d\u6709\u6548\r\n        req.setCharacterEncoding(\"UTF-8\");\r\n\r\n        \/\/ \u89e3\u51b3\u54cd\u5e94\u4e2d\u6587\u4e71\u7801\r\n        resp.setContentType(\"text\/html; charset=UTF-8\");\r\n\r\n        String action = req.getParameter(\"action\");\r\n\r\n        \/\/\u65b9\u6cd5\u4e8c\uff1a\u901a\u8fc7\u53cd\u5c04\u52a8\u6001\u83b7\u53d6\r\n        try {\r\n            \/\/ \u901a\u8fc7action\u4e1a\u52a1\u9274\u522b\u5b57\u7b26\u4e32\uff0c\u83b7\u53d6\u76f8\u5e94\u7684\u4e1a\u52a1 \u65b9\u6cd5\u53cd\u5c04\u5bf9\u8c61\r\n            Method method = this.getClass().getDeclaredMethod(action, HttpServletRequest.class, HttpServletResponse.class);\r\n\r\n\/\/            System.out.println(method);\r\n\r\n            \/\/ \u8c03\u7528\u76ee\u6807\u4e1a\u52a1 \u65b9\u6cd5\r\n            method.invoke(this,req,resp);\r\n        } catch (Exception e) {\r\n            e.printStackTrace();\r\n            throw new RuntimeException(e); \/\/ \u628a\u5f02\u5e38\u629b\u7ed9Filter\u8fc7\u6ee4\u5668\r\n        }\r\n    }\r\n}\r\n<\/code><\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>package top.qaqaq.pojo;\r\n\r\n\/**\r\n * @author RichieZhang\r\n * @create 2022-12-19 21:57\r\n *\/\r\npublic class Person {\r\n\r\n    private Integer id;\r\n    private String name;\r\n\r\n    public Person() {\r\n    }\r\n\r\n    public Person(Integer id, String name) {\r\n        this.id = id;\r\n        this.name = name;\r\n    }\r\n\r\n    public Integer getId() {\r\n        return id;\r\n    }\r\n\r\n    public void setId(Integer id) {\r\n        this.id = id;\r\n    }\r\n\r\n    public String getName() {\r\n        return name;\r\n    }\r\n\r\n    public void setName(String name) {\r\n        this.name = name;\r\n    }\r\n\r\n    @Override\r\n    public String toString() {\r\n        return \"Person{\" +\r\n                \"id=\" + id +\r\n                \", name='\" + name + '\\'' +\r\n                '}';\r\n    }\r\n}\r\n<\/code><\/pre>\n\n\n\n<p>web.xml<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n&lt;web-app xmlns=\"https:\/\/jakarta.ee\/xml\/ns\/jakartaee\"\r\n         xmlns:xsi=\"http:\/\/www.w3.org\/2001\/XMLSchema-instance\"\r\n         xsi:schemaLocation=\"https:\/\/jakarta.ee\/xml\/ns\/jakartaee https:\/\/jakarta.ee\/xml\/ns\/jakartaee\/web-app_6_0.xsd\"\r\n         version=\"6.0\">\r\n\r\n    &lt;servlet>\r\n        &lt;servlet-name>AjaxServlet&lt;\/servlet-name>\r\n        &lt;servlet-class>top.qaqaq.servlet.AjaxServlet&lt;\/servlet-class>\r\n    &lt;\/servlet>\r\n    &lt;servlet-mapping>\r\n        &lt;servlet-name>AjaxServlet&lt;\/servlet-name>\r\n        &lt;url-pattern>\/ajaxServlet&lt;\/url-pattern>\r\n    &lt;\/servlet-mapping>\r\n&lt;\/web-app><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>AJAX-\u4ec0\u4e48\u662fAJAX\u8bf7\u6c42 AJAX \u5373\u201cAsynchronous Javascript And XML\u201d\uff08 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[59],"tags":[61],"class_list":["post-2737","post","type-post","status-publish","format-standard","hentry","category-javaweb-code","tag-javaweb"],"_links":{"self":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts\/2737"}],"collection":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2737"}],"version-history":[{"count":1,"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts\/2737\/revisions"}],"predecessor-version":[{"id":2738,"href":"https:\/\/qaqaq.top\/index.php?rest_route=\/wp\/v2\/posts\/2737\/revisions\/2738"}],"wp:attachment":[{"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2737"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2737"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qaqaq.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2737"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}