I have just started out with servlets and jsp from HFSJ book I have a few doubts which you can help me clear:
Q 1. What actually is web server?If I am making a web site from my computer then is my computer the web server?
Q 2. Difference between
hardware server and software sever
server and web server
server and server application
container and web server
Q 3. Where is the container actually placed ?
Q 4. What do you mean by deploying a servlet in a container?
Q 5. Difference between Applet and Servlet ? Are applets standalone programs and are servlets standalone programs too?
Read this if it helps. Basically a web server is generally a server which can serve static content. A servlet container has the capability to run servlets inside it to produce dynamic content. The apache tomcat that we generally use works as both web server and servlet container (or it has apache web server inside it I don't remember). Hardware server is actually the machine that server the requests, and software server is the web server/container that runs on that machine to respond to requests. Applets are a completely different thing, servlets run on the server which applets run on the client side i.e. generally the browser.
Are applets standalone programs and are servlets standalone programs too?
Applets run in an applet container == the browser and servlets run in a servlet container == a web server which can host servlets.
Some important differences if you are used to only programming desktop applications:
Neither applets or servlet are started with a main() method, instead the initial class instance creation is handled by the container.
Both applet and servlet APIs specify life-cycle methods which you should pay close attention to.
I think you should take one step back and think what is server ? We define the server as mentioned below-
Server Definition - A server is a a software program, or the computer on which that program runs, that provides a specific kind of service to client software running on the same computer or other computers on a network.
Example of server - An example is a web server, which stores files related to web sites and serves (i.e., sends) them across the Internet to clients (i.e., web browsers) when requested by a user. By far the most popular web server program is Apache, which is claimed to host more than 68 percent of all web sites on the Internet.
If you are hosting the site at your machine, then definitely you might be using some web server like IIS or apache. Now on the basis of above definition just think whether your machine is server or not..
I hope this would clear your doubt regarding web server.
We begin by testing your absorbancy by exposing you to this tiny ad:
a bit of art, as a gift, that will fit in a stocking