my dog learned polymorphism
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes want to ask mock Q Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "want to ask mock Q" Watch "want to ask mock Q" New topic

want to ask mock Q

Wai Yip Lau

Joined: Jun 20, 2005
Posts: 23
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?
Mat Williams
Ranch Hand

Joined: Jul 20, 2005
Posts: 215

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.

can you post a link to the test ?

Sergey Tyulkin
Ranch Hand

Joined: May 10, 2005
Posts: 87
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 ]
I agree. Here's the link:
subject: want to ask mock Q
jQuery in Action, 3rd edition