Difficulty: Easy
Correct Answer: Correct
Explanation:
Introduction / Context:
Servlets are core server-side Java components that handle HTTP requests and generate responses. This question ensures you understand their deployment model and how they differ from client-side technologies like applets or JavaScript running in a browser.
Given Data / Assumptions:
Concept / Approach:
Servlets are deployed to the server and invoked per request by the container, which manages lifecycle methods (init, service, destroy). They are not downloaded and executed on the client. Any dynamic content they generate is delivered to the client as standard HTTP responses (HTML, JSON, etc.).
Step-by-Step Solution:
Verification / Alternative check:
Typical deployment: WAR files deployed to a servlet container; clients never run servlet bytecode locally.
Why Other Options Are Wrong:
Common Pitfalls:
Confusing servlets with applets or client-side scripts; assuming “Java = runs on client.”
Final Answer:
Correct
Discussion & Comments