您的位置:首页 > 文旅 > 旅游 > 长沙关键词优化方法_哪里有网站推广软件_爱站网长尾关键词挖掘_网站友情链接连接

长沙关键词优化方法_哪里有网站推广软件_爱站网长尾关键词挖掘_网站友情链接连接

2025/4/3 10:20:16 来源:https://blog.csdn.net/2301_80391652/article/details/146516077  浏览:    关键词:长沙关键词优化方法_哪里有网站推广软件_爱站网长尾关键词挖掘_网站友情链接连接
长沙关键词优化方法_哪里有网站推广软件_爱站网长尾关键词挖掘_网站友情链接连接

student.html

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<script src="js/jquery-3.7.1.min.js"></script>
<script src="js/student.js"></script>
</head>
<body><table border='1'><thead><tr><th>id</th><th>name</th><th>age</th><th>sex</th></tr></thead></tbody><tr><td>1</td><td>张三</td><td>20</td><td>男</td></tr></tbody></table></body>
</html>

student.js

//查找
$.ajax({url:"SearchServlett",type:"get",success:function(value){var arr = value.datafor(var i=0;i<arr.length;i++){$("tbody").append("<tr>"+"<td>"+arr[i].id+"</td>"+"<td>"+arr[i].name+"</td>"+"<td>"+arr[i].sex+"</td>"+"</tr>")}},error:function(){alert("出错啦!")},
})

 SearchSelvert

package com.qc.servlet;import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;import com.qc.db.MysqlUtil;/*** Servlet implementation class SearchServlett*/
@WebServlet("/SearchServlett")
public class SearchServlett extends HttpServlet {private static final long serialVersionUID = 1L;/*** @see HttpServlet#HttpServlet()*/public SearchServlett() {super();// TODO Auto-generated constructor stub}/*** @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)*/protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {String sql="select * from student";String[] colums= {"id","sex","age","name"};String res=MysqlUtil.getJsonBySql(sql, colums);response.setContentType("text/json;charset=utf-8");response.getWriter().write(res);}/*** @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)*/protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {// TODO Auto-generated method stubdoGet(request, response);}}

 

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com