java - 404 error not mapping with error page -
i have configure web.xml follow:
<?xml version="1.0" encoding="utf-8"?> <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" version="2.5"> <!-- config here. --> <servlet> <servlet-name>springconfig</servlet-name> <servlet-class>org.springframework.web.servlet.dispatcherservlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>springconfig</servlet-name> <url-pattern>*.htm</url-pattern> </servlet-mapping> <context-param> <param-name>contextconfiglocation</param-name> <param-value>classpath: springconfig.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.request.requestcontextlistener</listener-class> </listener> <error-page> <exception-type>404</exception-type> <location>/404error.html</location> </error-page> </web-app>
this simple 404error.html page located in webcontent folder:
<!doctype html> <html> <head> <meta charset="iso-8859-1"> <title>insert title here</title> </head> <body> page looking not available. </body> </html>
but not getting above custom page, can guys tell me missing?
try this. working fine in applications.
<error-page> <error-code>404</error-code> <location>/404error.html</location> </error-page>
Comments
Post a Comment