This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet Qeustion on VAJava Cert  RSS feed

 
Bartholemu Smith
Ranch Hand
Posts: 317
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The typical deployment of a servlet involves which of the following:
a) The servlet's class file is placed in one of the directories in the CLASSPATH of the Servlet Engine

b) The servlet is serialized and placed in the root directory of the Servlet Engine.

c) The servlet must be registered with the Servlet Engine before it can be found by a URL used in a web browser.

d) The Servlet Engine must be stopped and then restarted before the new servlet can be loaded.

Any ideas on what is the best answer?
Thanks
Faisal
 
Bal Sharma
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think best choice is A. BK
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, (a) is wrong because the Only Right Place[TM] for servlet class files (and application object code in general) is WEB-INF/classes or a jar in WEB-INF/lib. (b) is wrong because servlets aren't usually serialized, and you certainly don't need a serialized servlet to deploy. You do need to use the WEB-INF/web.xml file declare a servlet and map it to one or more virtual paths on the server, which counts as "register" I guess, making (c) correct. (d) may be true for some application servers, but others will re-load the configuration file and deploy the servlet without restart so it is false in general.
Which makes (c) the only plausible answer.
- Peter
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!