Details
-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
21.0.2.Final
-
None
-
-
Undefined
-
---
-
---
Description
I have a simple webapp war file with the following structure:
Listing archive: mywebapp.war--
Path = mywebapp.war
Type = zip
Physical Size = 1441Date Time Attr Size Compressed Name
------------------- ----- ------------ ------------ ------------------------
2020-12-23 20:09:20 ....A 18 18 error.html
2020-12-23 20:09:02 ....A 18 18 index.html
2020-12-23 20:10:13 D.... 0 0 META-INF
2020-12-23 03:16:37 ....A 39 39 META-INF\MANIFEST.MF
2020-12-23 20:12:38 D.... 0 0 WEB-INF
2020-12-23 20:12:28 D.... 0 0 WEB-INF\classes
2020-12-23 20:12:35 D.... 0 0 WEB-INF\lib
2020-12-23 20:11:54 ....A 480 248 WEB-INF\web.xml
------------------- ----- ------------ ------------ ------------------------
2020-12-23 20:12:38 555 323 4 files, 4 folders
In web.xml, it defines the error page:
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xmlns.jcp.org/xml/ns/javaee"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/web-app_4_0.xsd" version="4.0">
<display-name>mywebapp</display-name>
<welcome-file-list>
<welcome-file>index.html</welcome-file>
</welcome-file-list>
<error-page>
<location>/error.html</location>
</error-page>
</web-app>
After deploying the webapp successfully in local WildFly server.
Accessing the following URL will trigger the error page to be shown:
http://127.0.0.1:8080/mywebapp/dummy
http://127.0.0.1:8080/mywebapp/META-INF/MANIFEST.MF
http://127.0.0.1:8080/mywebapp/META-INF/dummy/dummy
However, the following URL will NOT trigger the error page:
http://127.0.0.1:8080/mywebapp/META-INF
http://127.0.0.1:8080/mywebapp/WEB-INF
http://127.0.0.1:8080/mywebapp/WEB-INF/web.xml
http://127.0.0.1:8080/mywebapp/WEB-INF/dummy/dummy
Instead, it just displays the text "404 - Not Found"