servlet:第一个demo

public class ServletDemo2 extends HttpServlet {

    public void doGet(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        response.getOutputStream().write("hello servlet".getBytes());
    }

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

}

posted @ 2017-03-02 10:46  贱贱的小帅哥  阅读(185)  评论(0编辑  收藏  举报