• 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
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Doubt on page 587 HFSJ

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,
On page 587 HFSJ , be the Container exercise, we have to match the servlets according to the requests.
In request no.3 --> http://localhost:8080/MapTest/fooStuff/bar/blue.do
The answer given to it is DeployTestThree. But I think it should be DeployTestTwo because it matches the path /fooStuff/bar.

Could anyone please clarify on this.

Thanks in Advance.
 
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Khadija ,
Observe the code again
 
chiranjeevi gunturu
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Khadija ,
Observe the code below:


here there is no slash (/*) after "/fooStuff/bar" which means it matches with exact url-pattern only.So obviously it chooses the servlet name Three. Thank you
 
chiranjeevi gunturu
Ranch Hand
Posts: 59
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Observe the code below:

since there is no slash (/*) after "/fooStuff/bar" which matches for exact paths only it chooses servlet name Three.Thank you
 
Khadija Lokhandwala
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks..I got it..
 
The longest recorded flight time of a chicken is 13 seconds. But that was done without this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic