程序显示请求的资源不可用

时间:2017-07-03 12:56:56

标签: java servlets

在java resources/src/abcdservlet中创建了servlet。我正在尝试执行显示请求的资源不可用。

import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class Abcd extends HttpServlet {
    private static final long serialVersionUID = 1L;

    public Abcd() {
        super();
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) 
            throws ServletException, IOException {
        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
        out.print("<html>");
        out.println("<body>");
        out.println("<h1> Welcome</h1>");
        out.println("</body>");
        out.print("</html>");


    }
}

0 个答案:

没有答案