Win a copy of AWS Security this week in the Cloud/Virtualization 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Question About Specification of Mappings

 
Ranch Hand
Posts: 634
Eclipse IDE Chrome 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
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its my request to fellow ranchers to Help me
 
Creator of Enthuware JWS+ V6
Posts: 3346
303
Android Eclipse IDE Chrome
  • 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
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Frits.
So, A is correct.
what are other ranchers view ?
 
When evil is afoot and you don't have any arms you gotta be hip and do the legwork, but always kick some ... tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic