Win a copy of Svelte and Sapper in Action this week in the JavaScript 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Servlet Qeustion on VAJava Cert

 
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
 
Ranch Hand
Posts: 273
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think best choice is A. BK
 
author
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
 
You’ll find me in my office. I’ll probably be drinking. And reading this tiny ad.
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic