Carpe Programming/jsp & spring & jstl
[spring] Spring MVC Exception Handling
nolite
2012. 3. 7. 13:25
In servlet web application,
it’s always recommended to display a custom friendly error page instead of the default
long java plain exception code. In web.xml, you can configure a custom
error page to map a specified error code or exception :
web.xml
--------------------------------------------------------------------------------------
<error-page>
<error-code>404</error-code>
<location>/WEB-INF/pages/404.jsp</location>
</error-page>
<error-page>
<exception-type>java.lang.Exception</exception-type>
<location>/WEB-INF/pages/404.jsp</location>
</error-page>
--------------------------------------------------------------------------------------
[출처] - http://www.mkyong.com/spring-mvc/spring-mvc-exception-handling-example/
728x90