相关疑难解决方法(0)

HTTP状态405 - 此URL不支持HTTP方法GET

我有以下servlet:

public class MyServlet extends HttpServlet {

    private static final long serialVersionUID = 16252534;
    private static int ping = 3000;
    private Thread t;
    private static boolean shouldStop = false;

    @Override
    public void init() throws ServletException {
        super.init();

        t = new Thread(new Runnable() { 
            @Override
            public void run() {
                while(!shouldStop) {
                    System.out.println("Now:" + System.currentTimeMillis());
                    try {
                        Thread.sleep(ping);
                    } catch (InterruptedException e) {
                        e.printStackTrace();
                    }
                }
            }
        });
        t.start();

    }
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp)
    throws ServletException, IOException {
        super.doGet(req, …
Run Code Online (Sandbox Code Playgroud)

servlets http-get http-status-code-405

22
推荐指数
1
解决办法
3万
查看次数

标签 统计

http-get ×1

http-status-code-405 ×1

servlets ×1