• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet request path confusion!

 
warren li
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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.

Thanks a lot.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's how welcomes files are looked for.

SRV.9.10 Welcome Files

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�.
 
warren li
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I understand the search for a welcome-file.

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.
 
Ali Gohar
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
warren li
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the explanation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic