Bug 984434 - Welcome-file defined in web subsystem is used only if there is no index.{htm,html,jsp}
Welcome-file defined in web subsystem is used only if there is no index.{htm,...
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Web (Show other bugs)
Unspecified Unspecified
unspecified Severity medium
: DR4
: EAP 6.4.0
Assigned To: Rémy Maucherat
Michael Cada
Depends On:
  Show dependency treegraph
Reported: 2013-07-15 04:45 EDT by Radim Hatlapatka
Modified: 2018-03-05 10:35 EST (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Radim Hatlapatka 2013-07-15 04:45:02 EDT
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 09:04:28 EDT
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 07:51:54 EDT
Issue is still valid in EAP 6.3.0.ER10
Comment 5 Kabir Khan 2014-09-26 16:17:27 EDT
Comment 6 Radim Hatlapatka 2014-10-10 06:08:24 EDT
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 06:46:10 EDT
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 07:38:43 EDT
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 10:28:52 EDT
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.

Note You need to log in before you can comment on or make changes to this bug.