我在eclipse里用Java编了一个Servlet的下程序 总是报
HTTPStatus404-/JD6/servlet/zxc.TestServlet-------------------------------------------...
HTTP Status 404 - /JD6/servlet/zxc.TestServlet
--------------------------------------------------------------------------------
type Status report
message /JD6/servlet/zxc.TestServlet
description The requested resource is not available.
--------------------------------------------------------------------------------
Apache Tomcat/7.0.69
希望大神帮忙
我的代码package zxc;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
public class TestServlet extends HttpServlet {
public TestServlet() {
super();
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter pw=response.getWriter();
pw.println("hello");
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
} 展开
--------------------------------------------------------------------------------
type Status report
message /JD6/servlet/zxc.TestServlet
description The requested resource is not available.
--------------------------------------------------------------------------------
Apache Tomcat/7.0.69
希望大神帮忙
我的代码package zxc;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.PrintWriter;
public class TestServlet extends HttpServlet {
public TestServlet() {
super();
}
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
PrintWriter pw=response.getWriter();
pw.println("hello");
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
doGet(request, response);
}
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询