Based on the following information, please construct the full path for the servlet. Mark
Please select one correct answer. docbase = c:/temp/ context path = /test alias name = MyMail servlet-name = com.jiris.common.util.MailServlet url-pattern = /mail/*
A : c:/temp/mail/com/jiris/util/MailServlet.class B : c:/temp/test/mail/com/jiris/util/MailServlet.class C : c:/temp/test/mail/util/MailServlet.class D : c:/temp/test/com/jiris/util/MailServlet.class
Correct answer is B. From explanation the url-pattern is also needed to construct the full path. But isn't the url-pattern is just a fake name that map to the servlet? Why it participate in the real path?
This same question was posted several days back. see this post.
As Sergey points out (apologies Sergey I have only just seen your post) I may have missed the point of the question.
I am not sure having reread the question that there is a correct answer. I agree with Sergey in this.
I wonder, if this mock exam is correct itself .... For example, servlet-name = com.jiris.common.util.MailServlet Note: servlet-name, not servlet-class. So we can make no assumptions about the servlet class itself.
I made a quick "google" and now i can make some assumptions. The question relates to Tomcat configuration file. The docBase is the root folder for web applications, the context path is a directory of the current web application. Still didn't get, 1) why do we need url-pattern 2) why we use servlet-name, and not servlet-class 3) why answer B doesn't have "common" part of the package [ August 15, 2005: Message edited by: Sergey Tyulkin ]