Win a copy of TDD for a Shopping Website LiveProject this week in the Testing 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

question on servlet mapping !!!

 
Ranch Hand
Posts: 1277
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ??
 
Bartender
Posts: 6663
5
MyEclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 563
Google Web Toolkit Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 !!!
 
Story like this gets better after being told a few times. Or maybe it's just a tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic