2014-03-12 60 views
0

如果我在URL中弄乱了文件名,它不会重定向到404页面例如。在J2EE应用程序中,URL未重定向到404页面

 http://10.2.3.22/xyz/404ewewqewqe.html - This url does not work 
     http://10.2.3.22/xyz/404, These 3 urls works fine 
     http://10.2.3.22/xyz/404ewqewqe,http://10.2.3.22/xyeewewqeweollows - 

在Apache中的httpd文件我有以下条目,如下 - 的ErrorDocument 404找到/404.html 任何帮助或指针将高度赞赏

回答

0

我不知道理解你的问题,但为什么不中使用了web.xml:

<error-page> 
    <exception-type>404</exception-type> 
    <location>/404error.html</location> 
</error-page> 

小心Servlet版本:How to specify the default error page in web.xml?

我用:

<error-page> 
    <exception-type>com.sun.faces.context.FacesFileNotFoundException</exception-type> 
    <location>/app/error.xhtml</location> 
</error-page> 

我希望这可以帮助你。

+0

此设置已配置为使我们无法将其移至web.xml。你看到Apache错误文档配置的任何问题来处理这种行为。 – Gaurav

+0

语法很简单,看起来正确.. 这不是一个正确的问题吗? http://stackoverflow.com/questions/4341263/custom-error-page-in-apache2-for-401 –

相关问题