Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jsp container vs servlet container

I am studying about servlet technology in which I heared the term servlet container and jsp container, I am getting confused that both are same or not.
A jsp page is handlded by jsp container but servlet is handled by servlet container.
On searching some site I found in servlet container there is a file called page compiler which turns servlet container into jsp contaner when a jsp request comes.

So I want to know, actually the conversion happens between these tow or both are the same things which is used interchangebly.

Thanks

like image 237
Deb Avatar asked May 21 '12 06:05

Deb


People also ask

What is a servlet and JSP container?

A JSP container is an entity that translates, executes, and processes JSP pages and delivers requests to them. The exact make-up of a JSP container varies from implementation to implementation, but it will consist of a servlet or collection of servlets. The JSP container, therefore, is executed by a servlet container.

What is difference between JSP and servlet?

Servlets are faster as compared to JSP, as they have a short response time. JSP is slower than Servlets, as the first step in the JSP lifecycle is the conversion of JSP to Java code and then the compilation of the code. Servlets are Java-based codes. JSP are HTML-based codes.

What is the difference between servlet container and Web container?

Web containers are a part of a web server and they generally processes the user request and send a static response. Servlet containers are the one where JSP created components reside. They are basically responsible to provide dynamic content as per the user request.

Is Tomcat a servlet container?

Although its flexible configuration and interoperability with supporting technologies have enabled Apache Tomcat to act as a web application server in many circumstances, Tomcat is primarily a Java servlet container.


1 Answers

First of all, there is no such thing as a JSP container which is not a Servlet container because a JSP is translated into Servlet before it is executed. So a JSP container must support Servlet.

The opposite is not always true, at least in the old times when Servlet technology first came into existence and the container was called Servlet container.

When JSP came out, an engine that interprets and processes JSP pages into a servlet is added to the old Servlet container and people usually call such a container JSP/Servlet container. Nowadays, JSP container and Servlet container more or less mean the same thing because they both support JSP and Servlet.

like image 79
dragon66 Avatar answered Oct 12 '22 13:10

dragon66