问答详情
源自:-

老师,第一个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
    
    }

}


提问者:Jaygee 2015-09-05 11:20

个回答