public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException { String userName = req.getParameter("userName"); System.out.println("Hello"+userName); }
<body> This is 404 Page. <br> </body>
<body> This is error Page. <br> </body>
<error-page> <error-code>404</error-code> <location>/WEB-INF/jsp/404.jsp</location> </error-page> <error-page> <error-code>java.lang.Exception</error-code> <location>/WEB-INF/jsp/error.jsp</location> </error-page> <servlet> . . .
public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException { String userName = req.getParameter("userName"); System.out.println("Hello"+userName); throw new ServletException("test"); }
转载请标明出处:Servlet入门学习(二)
文章来源: Servlet入门学习(二)