• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servers

 
bharat bhasin
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 9509
22
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13055
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 257
Hibernate Oracle Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic