Friday, November 1, 2013

Servlet, the way you see it

Hey, have you ever thought of having a book from library ?
Of course, I have done that. Do you think that, I don't read books ?

No,  never. In fact reading books is a good hobby indeed.
Hey, I know that very well. Let's come to the straight point. Don't you think that easy way ?

Well, of course yes. Today I am going to tell you how a library system works.
I don't know why you are doing this. STILL GO ON.

Let's assume that you are going to issue a book on Hibernate.

You went to a library to get a book "JUST HIBERNATE" by O'rEILLY of 2nd Eddition. You meet the librarian and she asked you to fill up a requisition slip. You filled the slip which has three columns
  1. Name of the book
  2. Name of the publisher - O' REILLY
  3. Edition- 2nd Edition
You give this slip to librarian . Now librarian will read the request and will check in the register which bookshelf is having the book you  requested and will go to the shelf and find out the book and will hand it over to you.

Is that the way you borrow a book ?
Yeah, pretty much the same way.

Well, let's check this out in Java way in a web context !!!
You want some service from a server and you push a request to the server with some details you provide over the form (Requisition Slip) you see. There sits a container (Librarian) in the server side (Library), which reads the register (web.xml) for appropriate servlet (Bookshelf) and the servlet returns the response (Specified Book) and the response is sent to the client (You yourself) by the container.

Contributed by:                Amrita Pattnaik
Edited and re-written by:  Palash Kanti Kundu
Palash Kanti Kundu Palash Kanti Kundu Palash Kanti Kundu Palash Kanti Kundu

No comments:

Post a Comment