服务器接送数据,返回数据
package 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; @WebServlet("/SignServlet") public class Ejdkm extends HttpServlet { private static final long serialVersionUID = 1L; public Ejdkm() { super(); } protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { request.setCharacterEncoding("utf-8"); String account = request.getParameter("account"); String password = request.getParameter("password"); //链接数据库验证数据等操作 String respon=""; //根据需求返回值 response.getWriter().append(respon);//返回值 } protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } }