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)
SharedWebMetaDataBuilder.init could clear the list before adding the welcome files if some have been defined in the container config.
Issue is still valid in EAP 6.3.0.ER10
https://github.com/jbossas/jboss-eap/pull/1732
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.
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
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.
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.