3 Difference betwixt Web Server vs Application vs Servlet Containers inwards Java JEE

In the Java EE, or J2EE or JEE world, at that spot are a lot of confusion betwixt terminology, which is quite evident that forthwith nosotros convey iii words (J2EE, Java EE, together with JEE) to depict the same applied scientific discipline platform. You volition come across Java developers using the price similar Web Server, Application Server, together with Web containers interchangeably but they are non just same. The primary divergence betwixt Web server together with application server is that spider web server is meant to serve static pages e.g. HTML together with CSS, spell Application Server is responsible for generating dynamic content past times executing server side code e.g. JSP, Servlet or EJB. One of the most pop spider web servers is Apache HTTPD which is oft used inward conjunction amongst Tomcat to host many Java spider web application. Now, tomcat is non just an application server, it's to a greater extent than of a servlet engine or spider web container or likewise known equally servlet containers because it provides the runtime surround for Servlet together with JSP but doesn't render the services similar EJB together with distributed transaction which are a fundamental characteristic of the application server inward Java JEE world.



Web Server vs Application Server vs Web Containers

From the commencement business office its is clear that Web server serves static content, but, both spider web containers together with application servers dynamic content. Let's come across a duad of to a greater extent than points to sympathize the divergence betwixt Web together with Application Server equally good Servlet engines similar Tomcat together with Jetty.



1) Examples
In lodge to amend sympathize the difference, you lot must know about pop examples of the spider web server, application server, together with spider web containers. Apache together with IIS are 2 pop spider web servers. Apache is used everywhere including Java globe but IIS is to a greater extent than pop inward Microsoft ASP .NET world. From Java EE perspective duad of pop application servers are IBM WebSphere, Oracle WebLogic, Glassfish together with Redhat's JBoss. Coming dorsum to spider web containers or servlet engines, Apache Tomcat together with Jetty are 2 of the most pop Servlet engine inward Java spider web world.



2) Features together with Responsibility
The meaning divergence betwixt spider web server together with application server comes from a responsibleness perspective. Web servers are responsible for serving static content e.g. HTML over HTTP protocol spell application server is responsible for serving dynamic content, managing EJB pool, facilitating distributed transaction, facilitating application lookup over JNDI, application safety together with others. While spider web containers are solely responsible for generating HTML past times executing JSP together with Servlet on Server side.

This is likewise i of the pop questions on Java JEE interviews, but for amend preparation, you lot tin likewise refer Java Programming Interview Exposed book, i of the best to laid upward for Java spider web evolution interviews.




3) Service
One to a greater extent than divergence betwixt an application server together with spider web server comes from the service perspective. It's expected from a Web server to render HTTP protocol score service spell application server is supposed to render to a greater extent than powerful together with dynamic Web service together with delineate concern score service via EJB (Enterprise Java Beans). Essential services similar Database connecter pooling is non solely provided past times application server but likewise past times Web containers similar Tomcat. You tin read to a greater extent than virtually how to setup connecter puddle inward tomcat here.


4) Usage
Once you lot know the divergence betwixt spider web together with application server together with spider web containers, it's slow to figure out when to usage them. You involve a spider web server similar Apache HTTPD if you lot are serving static spider web pages. If you lot convey a Java application amongst simply JSP together with Servlet to generate dynamic content hence you lot involve spider web containers similar Tomcat or Jetty. While, if you lot convey Java EE application using EJB, distributed transaction, messaging together with other fancy features than you lot involve a total fledged application server similar JBoss, WebSphere or Oracle's WebLogic.

You tin likewise usage spider web server together with application server together inward the same setup equally shown inward the next example:

 at that spot are a lot of confusion betwixt terminology 3 Difference betwixt Web Server vs Application vs Servlet Containers inward Java JEE



That's all virtually the difference betwixt Web Server, Application Server together with Servlet Container in Java together with JEE world. Remember, each i of the convey dissimilar role together with many times used together inward Java Web world. For example, i of the pop setups is apache fronting Tomcat. You tin usage this setup if your Web application is solely using JSP together with Servlet together with doesn't involve EJB or distributed transaction feature. More basic services similar Database connecter pooling is likewise provided past times Tomcat. On the other hand, if you lot convey total fledged Java EE application including EJB hence you lot involve a proper application server similar WebSphere, WebLogic or JBoss to host your application.

Further Learning
Java Web Fundamentals By Kevin Jones
Introduction to Spring MVC
Head First Servlet together with JSP

Subscribe to receive free email updates:

0 Response to "3 Difference betwixt Web Server vs Application vs Servlet Containers inwards Java JEE"

Posting Komentar