在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>");
}
}