404 Not Found Spring Mvc Controller Code Example


Example 1: create spring 404 error controller

server.error.whitelabel.enabled=false

Example 2: spring mvc 404 page not found

<web-app ...>    <servlet>   	<servlet-name>mvc-dispatcher</servlet-name>         <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>         <load-on-startup>1</load-on-startup>   </servlet>    <servlet-mapping>  	<servlet-name>mvc-dispatcher</servlet-name>         <url-pattern>*.htm</url-pattern>   </servlet-mapping>    //...   <error-page> 	<error-code>404</error-code> 	<location>/WEB-INF/pages/404.htm</location>   </error-page>  </web-app>

Comments

Popular posts from this blog

Converting A String To Int In Groovy

"Cannot Create Cache Directory /home//.composer/cache/repo/https---packagist.org/, Or Directory Is Not Writable. Proceeding Without Cache"

Android How Can I Convert A String To A Editable