「JavaServlet」エラーページを設定するサンプル

web.xml

   <error-page>
    <error-code>404</error-code>
    <location>/error/404.html</location>
  </error-page>
  <error-page>
    <exception-type>javax.servlet.ServletException</exception-type>
    <location>/error/error.jsp</location>
  </error-page>
  	<error-page>
		<exception-type>java.lang.Exception</exception-type>
		<location>/error/exception.jsp</location>
	</error-page>

 

Java

Posted by arkgame