jsp如何包含一个servlet?请举一个例子?

想要包含一个servlet得用下列的方法,it is alleged that include file="servlet1" can not work。


例 4.4.2


<html>
<body>
    <jsp:include page="/Cookie/DeleteCookie" flush="true" />
</body>
</html>



package com;
import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class DeleteCookie extends HttpServlet {
    protected void doGet(HttpServletRequest request,
            HttpServletResponse response) throws ServletException, IOException {
        System.out.println("hello");
    }
}

更多内容请见原文,原文转载自:https://blog.csdn.net/qq_44594371/article/details/103176125

 

posted @ 2022-01-29 19:33  malala  阅读(31)  评论(0编辑  收藏  举报