File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes A basic question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "A basic question" Watch "A basic question" New topic

A basic question

Hui Zhao
Ranch Hand

Joined: Jul 09, 2007
Posts: 116
Why use servlet?
Since we can establish the interaction with stream socket between
client and server.So what is the purpose of servlet?
Is stream socket not enough founctioned?

Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Hui Zhao,

First, please see:
"A basic question doesn't really describe this question very well".

We use servlets because they're a higher level abstraction than sockets. By leveraging the work of those who came before us, we are able to focus more clearly on the task at hand (web developement) and not on low level details of TCP/IP, the OSI layer's, the finer details of the HTTP protocol.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
I agree. Here's the link:
subject: A basic question
It's not a secret anymore!