• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question About Specification of Mappings

 
Mohit G Gupta
Ranch Hand
Posts: 634
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JPliotTest




Consider the following servlet mapping.


Which of the following are true for the above mapping in the deployment descriptor


Select all 2 correct Choices.


A. /do/this/index.html request is handled by the DoThisServlet.

B. /do/this/whatto.do request is handled by the DoServlet.

C. /dothat/forthis.html request is handled by DoThatServlet.

D. /dothat request is handled by the default servlet.

Correct Answer is A and D

I think answer should be only A.

My Analyses :

/do/this/index.html-
First container would try to find a exact match .its not found so container goes for directory match .it matches .so A is correct

/do/this/whatto.do
Container would try to find a exact match its not found so it goes for directory match .so
.It matches .so B is incorrect.
Request goes to DoThisServlet

/dothat/forthis.html
There is not extension match or a directory match and neither a exact match
It may result in default servlet or an error page

/dothat
THere is a exact match

It will map to DoThatServlet

Please provide help
 
Mohit G Gupta
Ranch Hand
Posts: 634
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its my request to fellow ranchers to Help me
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2536
113
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with you! Only A is a correct answer.

Regards,
Frits
 
Mohit G Gupta
Ranch Hand
Posts: 634
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Frits.
So, A is correct.
what are other ranchers view ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic