• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

question on servlet mapping !!!

 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ??
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Celinio Fernandes
Ranch Hand
Posts: 549
Eclipse IDE Google Web Toolkit Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Niranjan Deshpande
Ranch Hand
Posts: 1277
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic