This week's book giveaways are in the Cloud and AI/ML forums. We're giving away four copies each of Cloud Native Patterns and Natural Language Processing and have the authors on-line! See this thread and this one for details.
Referring to page 593 of HFSJ book. Keep reading even if you don't have the book.
The client request a url "http://www..../MyTestApp/search". If the container can't find the servlet mapping that matches this URL in the DD, then it looks in the "/MyTestApp/search" directory.
Is this true that if such a url is not found in the DD, it will look at the physical directory for some welcome files? Is this really the search sequence by the container? I thought the URL requested by the client has nothing to do with physical directory.
The use for this facility is made clear by the following common example: A welcome file of �index.html� can be defined so that a request to a URL like host ort/webapp/directory/, where �directory� is an entry in theWAR that is not mapped to a servlet or JSP page, is returned to the client as �host ort/ webapp/directory/index.html�.
What I don't understand and my real question is, even if "/MyTestApp/search" is just a path requested by the client, which has nothing to do with the physical path, will the container still look for "/MyTestApp/search/index.html"? Obviously the client does not know anything about the physical directories.
Yes, i think it will search for welcome file there if you have defined welcome-file-list in your DD. Client knows or not about the directories, but container will make it sure by looking at the physical directories whether one exist or not. If yes then it will try to lookup for the welcome page if one is there.