我正在编写最简单的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>");
}
}