Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache 在J2EE应用程序中,URL未重定向到404页_Apache_Jakarta Ee_Http Status Code 404 - Fatal编程技术网

Apache 在J2EE应用程序中,URL未重定向到404页

Apache 在J2EE应用程序中,URL未重定向到404页,apache,jakarta-ee,http-status-code-404,Apache,Jakarta Ee,Http Status Code 404,例如,如果我弄乱了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 http

例如,如果我弄乱了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文件中,我有以下条目: 错误文档404/404.html
非常感谢您的帮助或指点

我不确定是否理解您的问题,但为什么不使用Web.xml:

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

404
/404error.html
请注意servlet版本:

我使用:

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

com.sun.faces.context.FacesFileNotFoundException
/app/error.xhtml

我希望这能对您有所帮助。

此设置的配置方式使我们无法将其移动到web.xml。您是否发现处理此行为的Apache错误文档配置有任何问题。语法简单且似乎正确。。这不是一个正确的问题吗?