为了账号安全,请及时绑定邮箱和手机立即绑定

老师,第一个servlet编写包500错误求解,和视频的没区别



package servlet;

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

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

public class HelloServlet extends HttpServlet {

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // TODO Auto-generated method stub
        System.out.println("处理get请求。。。");
        PrintWriter out = response.getWriter();
        out.println("<strong>Hello Servlet</strong><br>");
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // TODO Auto-generated method stub
    
    }

}


正在回答

0 回答

举报

0/150
提交
取消

老师,第一个servlet编写包500错误求解,和视频的没区别

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信