ajax的常规操作(原始方式)

package com.csdn.servlet;
import jakarta.servlet.GenericServlet;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.annotation.WebServlet;
import java.io.IOException;
import java.io.PrintWriter;
//演示Ajax
@WebServlet("/h09")
public class AjaxServlet extends GenericServlet {
    @Override
    public void service(ServletRequest servletRequest, ServletResponse servletResponse) throws ServletException, IOException {
        String uname = servletRequest.getParameter("uname");
        uname = uname.toUpperCase();
        PrintWriter out = servletResponse.getWriter();
        out.println(uname);
        out.flush();
    }
}



    
    ajax01
    


        uname:
        
服务器响应回来的内容: 

ajax的常规操作(原始方式)_第1张图片

你可能感兴趣的:(#,Ajax,Json,ajax,前端,Servlet,innerText,onclick)