| Author |
question on servlet mapping !!!
|
Niranjan Deshpande
Ranch Hand
Joined: Oct 16, 2005
Posts: 1277
|
|
Assume that the following servlet mapping is defined in the deployment descriptor of a web application: Which of the following requests will not be serviced by TestServlet? (Select one) a /hello.asp b /gui/hello.asp c /gui/hello.asp/bye.asp d /gui/*.asp e /gui/sales/hello.asp f /gui/asp Answer: f Explanation Here, any request that ends with .asp will be directed to TestServlet. Thus,only answer f will not be serviced by TestServlet. But what i want to day is - "As per HFSJ, the extension directory pattern for a servlet url-pattern must me mandatorily *.do. So the above d.d is invalid ? is it ??
|
SCJP 1.4 - 95% [ My Story ] - SCWCD 1.4 - 91% [ My Story ]
Performance is a compulsion, not a option, if my existence is to be justified.
|
 |
Deepak Bala
Bartender
Joined: Feb 24, 2006
Posts: 6588
|
|
|
The dd above is vald. *.whatever is a valid mapping. They have shown you a fragment of the DD and you are supposed to assume that it maps to a servlet properly.
|
SCJP 6 articles - SCJP 5/6 mock exams - SCJP Mocks - SCJP 5 Mock exam (Word document ) - SCJP 5 Mock exam in Java.Inquisition format
|
 |
Celinio Fernandes
Ranch Hand
Joined: Jun 28, 2003
Posts: 546
|
|
And I will complete this post by saying that you cannot start an extension mapping with a /. You cannot have any prepending path for an extension mapping. So /*.* or test/*.jsp would not be valid extension mapping.
|
SCJP 1.4, SCWCD 1.4, SCBCD 1.3, SCBCD 5
Visit my blog
|
 |
Niranjan Deshpande
Ranch Hand
Joined: Oct 16, 2005
Posts: 1277
|
|
The dd above is vald. *.whatever is a valid mapping. They have shown you a fragment of the DD and you are supposed to assume that it maps to a servlet properly.
hey john please refer hfsj page 586. the book clearly says the the extension mapping must begin with a * and after the astersisk must have dot wait.....in the bracket the book says ( .do, .jsp etc ) i didnt read it now i got it so *.jsp *.asp *.do anything is allowed !!!
|
 |
 |
|
|
subject: question on servlet mapping !!!
|
|
|