• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

servlet request path confusion!

 
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for the explanation.
 
Well THAT's new! Comfort me, reliable tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic