• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

welcome file list

 
Nikhil Jain
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Ranchers,

I need to clear the concept for <Welcome-File-List>, I have the following questions
1. Does the welcome file concept only applies to partial URL .i.e
eg1: http://www.wickedlysmart.com/MyTest/search
eg2: http://www.wickedlysmart.com/MyTest/search/

Which of the above two example would be considered as partial URLs & which of the above two example you would consider a directory. Because in HFS it says in one of the example that http://www.wickedlysmart.com/MyTest/search refers to a request to a directory, where according to me, its a request to a particular servlet like http://www.wickedlysmart.com/MyTest/search.do . If its a request to a directory, then there should be a slash at the end?

2. When does the server return 404 error, The HFS says when the url does not match the servlet mappings in web.xml, the container would return 404 error.
or
Is it this way
if No Servlet Mapping found, then check <welcome-file-list>, if no matching found then return 404 error

thanksin advance...
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) If it refers to a directory, a slash will automatically get added for you. If it refers to both a directory and a servlet mapping then I'm not sure what it would do and you won't be tested on that. My guess is that the servlet would get priority when it refers to both and there is no slash, but it might even vary from container to container.

2) If no servlet match is found, the file server will still try to find a match with one of its files. If the user asked for something that matches a valid directory, then yes the welcome files would likely be checked.

I hope that in the real world you'll never have to know the difference.
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

1. When the request come to the container. It search for the URL mapping. If the mapping found , the resource is used.

2. If the mapping not found, it search for the physical file. If found, process the request.

3. If no physical file found, and the request is not end with / , the / is added. The files specified in the welcome file list, is added on by one. and repeat the step 1 and 2.

4. If no mathch found, then display 404 error or container default.


Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic