Reputation: 1189
I am trying to create sample web project to understand the concept. I am facing some issues.
After executing the application on Java web server
, Welcome list page doesn't get displayed.
When i googled , basic reason , I found is location of index.html
is incorrect or it is not mentioned in web.xml
file. In my case , I think it is correct.
Please Guide. following are the screen shots.
Regards
Prat
Edit :
Upvotes: 0
Views: 1852
Reputation: 3180
welcome-file-list in web.xml
The welcome-file-list element of web-app, is used to define a list of welcome files. Its sub element is welcome-file that is used to define the welcome file.
A welcome file is the file that is invoked automatically by the server, if you don't specify any file name.
By default server looks for the welcome file in following order:
If none of these files are found, server renders 404 error.
If you have specified welcome-file in web.xml, and all the files index.html, index.htm and index.jsp exists, priority goes to welcome-file.
If welcome-file-list entry doesn't exist in web.xml file, priority goes to index.html file then index.htm and at last index.jsp file.
<web-app>
<welcome-file-list>
<welcome-file>home.html</welcome-file>
<welcome-file>default.html</welcome-file>
</welcome-file-list>
</web-app>
Now, home.html and default.html will be the welcome files.
If you have the welcome file, you can directory invoke the project as given below:
http://localhost:8080/projectname
Upvotes: -1