• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Use of URL Paths

 
Al Pearson
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Servlet Spec 2.3, the chapter on Mapping Requests to Servlets, first section Use of URL Paths, reads:
"Upon receipt of a client request, the web container determines the web application
to which to forward it. The web application selected must have the the longest
context path that matches the start of the request URL. The matched part of the URL
is the context path when mapping to servlets."
I don't understand the "The web application selected must have the the longest
context path that matches the start of the request URL" bit.
Could somebody explain this a little further, with a couple of examples?
Alan
 
Andriy Podlyesnyy
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for example you have two application on your container firts with context
www.some.com/mycontext
and second
www.some.com/mycontext/mycontext2
so when client calls URL http://www.some.com/mycontext/mycontext2/someServlet
second context will be used and when client calls
http://www.some.com/mycontext/someServlet2
first context will be used
 
Al Pearson
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks, Andriy, that's as clear as crystal.
Alan
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic