This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Servlets and the fly likes Servers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servers" Watch "Servers" New topic
Author

Servers

bharat bhasin
Greenhorn

Joined: Jul 19, 2009
Posts: 19
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?
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

bharat bhasin wrote:
Q 3. Where is the container actually placed ?

search for "tomcat and apache.

bharat bhasin wrote:
Q 4. What do you mean by deploying a servlet in a container?


search for "servlet life cycle"

bharat bhasin wrote:
Q 5. Difference between Applet and Servlet ? Are applets standalone programs and are servlets standalone programs too?


also servlet vs applet in google [sorry if you dont have the net connection ]
Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9307
    
  17

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.

HTH


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12809
    
    5
Are applets standalone programs and are servlets standalone programs too?


No

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.

Bill
bharat bhasin
Greenhorn

Joined: Jul 19, 2009
Posts: 19
thanks a lot everybody..
But please clear this for me
What actually is web server?If I am making a web site from my computer then is my computer the web server?
Salil Vverma
Ranch Hand

Joined: Sep 06, 2009
Posts: 255

Hey Bharat,

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.


Regards
Salil Verma
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Servers