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 on servlet mapping !!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "question on servlet mapping !!!" Watch "question on servlet mapping !!!" New topic
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: 6661
    
    5

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 - More SCJP Mocks
Celinio Fernandes
Ranch Hand

Joined: Jun 28, 2003
Posts: 547

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 !!!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: question on servlet mapping !!!
 
Similar Threads
How to call a Servlet from href tag?
Servlet not being called
Servlet path stupid question
Trouble Loading my First Servlet
About servlet-mapping