File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Question About Specification of Mappings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Question About Specification of Mappings" Watch "Question About Specification of Mappings" New topic
Author

Question About Specification of Mappings

Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634

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


OCPJP 6.0 93%
OCPJWCD 5.0 98%
Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634

Its my request to fellow ranchers to Help me
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1665
    
  25

I agree with you! Only A is a correct answer.

Regards,
Frits
Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634

Thanks Frits.
So, A is correct.
what are other ranchers view ?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question About Specification of Mappings