为什么最简单的服务器返回" $ END $"访问" /"

时间:2017-05-26 15:30:20

标签: java servlets java-ee

我正在编写最简单的servlet,当使用/ url在本地运行tomcat时,网页返回$ END $,我想知道为什么?

servlet本身是最简单的

import javax.servlet.annotation.WebServlet;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet(name="Hello" ,urlPatterns={"/Hello"},loadOnStartup=1)
public class Hello extends javax.servlet.http.HttpServlet {

    protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException {
        PrintWriter out = response.getWriter();
        out.println("<html>");
        out.println("<body>");
        out.println("Hello world"+"<br />");
        out.println("</body>");
        out.println("</html>");
    }
}

0 个答案:

没有答案