0% found this document useful (0 votes)
50 views2 pages

Servelet Vs JSP

The document compares and contrasts JSP and servlets in 6 key areas: 1) JSPs act as views while servlets act as controllers. 2) JSPs contain HTML, Java scripts, JSP elements and directives while servlets use only Java code. 3) JSPs are document-centric while servlets act like programs. 4) JSPs are used for presentation while servlets are used for business logic. 5) Servlets are faster than JSPs. 6) Client-side validation is possible in servlets but not in JSPs.

Uploaded by

pramod.kiit6398
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views2 pages

Servelet Vs JSP

The document compares and contrasts JSP and servlets in 6 key areas: 1) JSPs act as views while servlets act as controllers. 2) JSPs contain HTML, Java scripts, JSP elements and directives while servlets use only Java code. 3) JSPs are document-centric while servlets act like programs. 4) JSPs are used for presentation while servlets are used for business logic. 5) Servlets are faster than JSPs. 6) Client-side validation is possible in servlets but not in JSPs.

Uploaded by

pramod.kiit6398
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Differences: 1)In MVC, jsp act as a view and servlet act as a controller.

2)JSP pages contain a mixture of HTML, Java scripts, JSP elements, and JSP directives while servlet is totally uses java code. 3)Java Server Pages is that they are document-centric. Servlets, on the other hand, look and act like programs. 4)JSP is basically used for presentation and servlet is used for bussiness logic 5)Servlets are faster than jsp. 6)In Servlet, clientside validation is possible whereas clientside validation is not possible in JSP.

Difference between a Web Server, Web Container, and an Application Server A Web Server is a server capable of receiving HTTP requests, interpreting them, processing the corresponding HTTP Responses and sending them to the appropriate clients (Web Browsers). Example: Apache Web Server. Read more about Web Servers and their working>>

A Web Container is a J2EE compliant implementation which provides an environment for the Servlets and JSPs to run. Putting it differently we can say that a Web Container is combination of a Servlet Engine and a JSP Engine. If an HTTP Request refers to a Web Component (typically a Servlet or a JSP) then the request is forwarded to the Web Container and the result of the request is sent back to Web Server, which uses that result to prepare the HTTP Response for the particular HTTP Request. Example: Tomcat is a typical Web Container. A typical setup would be to have Apache HTTP Server as the Web Server and Tomcat as the Web Container. An Application Server is a complete server, which provides an environment for running the business components (EJBs, ADF BCs, etc.) in addition to providing the capabilities of a Web Container as well as of a Web Server. Example: Bea WebLogic, IBM WebSphere, Oracle Application Server, etc.

You might also like