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.
Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

servlet request path confusion!

 
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.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • 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.
 
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
Boost this thread!