Bug 984434

Summary: Welcome-file defined in web subsystem is used only if there is no index.{htm,html,jsp}
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Radim Hatlapatka <rhatlapa>
Component: WebAssignee: Rémy Maucherat <rmaucher>
Status: CLOSED CURRENTRELEASE QA Contact: Michael Cada <mcada>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.1.1CC: myarboro
Target Milestone: DR4   
Target Release: EAP 6.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Radim Hatlapatka 2013-07-15 08:45:02 UTC
Description of problem:
The defined welcome-file is put at the end of the list of welcome-files instead of the beginning thus it results that predefined index.* in SharedWebMetaDataBuilder are used instead if they appear in the deployed WAR.


How reproducible: always


Steps to Reproduce:
1. Start EAP and connect via cli
2. /subsystem=web/configuration=container:write-attribute(name=welcome-file, value=[welcome.html])
3. deploy simple WAR (e.g. simple.war) containing index.html and welcome.html (*no* welcome-file defined in web.xml)
4. access root of the deployed web app (e.g. http://localhost:8080/simple/)

Actual results:
content of the index.html appears

Expected results:
content of the welcome.html

Additional info:
The best solution is probably just putting the newly defined welcome-files at the beginning of the list.

Other solution could be if welcome-file is defined globally via Web subsystem it should redefine default list of welcome-files (of course the welcome-file definition in web.xml would take precedence to all global setting)

Comment 1 Rémy Maucherat 2013-07-15 13:04:28 UTC
SharedWebMetaDataBuilder.init could clear the list before adding the welcome files if some have been defined in the container config.

Comment 4 Radim Hatlapatka 2014-08-01 11:51:54 UTC
Issue is still valid in EAP 6.3.0.ER10

Comment 5 Kabir Khan 2014-09-26 20:17:27 UTC
https://github.com/jbossas/jboss-eap/pull/1732

Comment 6 Radim Hatlapatka 2014-10-10 10:08:24 UTC
Now it is possible to define the welcome-file correctly but using undefine doesn't properly reset the values to default and uses the previously set list of welcome files instead.

Comment 7 Radim Hatlapatka 2014-10-10 10:46:10 UTC
1. use the same steps as shown in description
2. undefine the welcome-file (/subsystem=web/configuration=container:undefine-attribute(name=welcome-file)
3. reload the server
4. use the step 4 in description and see that still the content welcome.html is shown instead of the one in index.html

Comment 8 Rémy Maucherat 2014-10-10 11:38:43 UTC
I will not make any further changes to this.

The problem with this new scenario is the shared metadata is created at boottime from the config (in WebSubsystemAdd.performBoottime and duplicates BZ 1115443), and also the shared metadata builder class uses static fields for welcome files and mime mappings (another minor issue that would need to be fixed after the first part).

Similar behavior on other items: mime mappings, native, instanceid, default session timeout, default virtual server.

So your bug resolution is wrong: the bug originally described is fixed but there is another unrelated issue that is a duplicate of 1115443
Setting back to ON_QA to confirm the original issue is fixed.

Comment 9 Radim Hatlapatka 2014-10-10 14:28:52 UTC
I have verified with EAP 6.4.0.DR4 that the configuration option welcome-file behaves as expected with exception of the issue mentioned in Comment 7 which is now tracked in separate BZ#1151478.