java中,写一个servlet,怎么写一个弹出的消息框?

如题。写在servlet。
2024-12-16 19:07:42
推荐回答(1个)
回答1:

servlet中 输出 JAVASCRIPT 就是了

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class Test extends javax.servlet.http.HttpServlet implements javax.servlet.Servlet {

public Test() {
super();
}

protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter pw=response.getWriter();
pw.write("");
}

protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
this.doGet(request, response);
}
}