A Brief Introduction to Servlets and JSP
April 5, 2000
In this article we will discuss only HTTP servlets and hence
when we mention servlet we mean HTTP Servlet.
A Servlet, in simple terms, is a Java program running under a web
server taking a 'request' object as an input and responding back
by a 'response' object.
Typically a web browser will send the request in HTTP format. The
servlet container will convert that into a request object.
Similarly the response object - populated by the servlet is
converted into an HTTP response by the servlet container.
This mechanism makes the browser - web server interaction very
easy.
You can check the Advantages of Servlets at
JavaBoutique: What are the Advantages of Servlets over Traditional
CGI?
A Java Server Page (JSP) is syntactically very similar to ASP
except for the programming language / Script which is Java in case
of JSP.
So similar to ASP one can embed the java code within <%
and %> tags with rest of your HTML code , in the same file. The
code within <% and %> tags: the Java code is executed on
the server and the HTML part with evaluated java code (result)
is passed to the requesting client.
You can check advantages of JSP at
What are the Advantages of JSP?
Here are the links to parts of Sun web site about Servlet,
Java Servlet API
and
JavaServer Pages (JSP).
Building Web Applications Using Servlets and JSP
Building Web Applications Using Servlets and JSP
Servlet
|