Introduction to Servers

This article mainly focuses the developers who wants to get the Oracle Certified Expert, Java EE 6 Web Component Developer (OCEWCD 6 - 1Z0-899) certification. In this article you will get a brief introduction of web servers, application servers and Servlet containers.

I noticed in my classes; there were some students, even do not know what kind of web development they are going to learn. They thought the OCEWCD is all about HTML, JavaScript and CSS, so this article starts with an introduction to client side applications and server side applications. There are two components in a web application. We call them as server side application and client side application. If you take an application, the fancy stuffs you see in your web browser belong to the client side. The background business logic, database access, session management and even more functional requirements are handled by server side component. Client side developers mostly use HTML, JavaScript, CSS, etc to develop the application. They are the artists and they know the way to attract the users. On the other hand, server side developers use languages like Java, Perl or PHP where the main concern is serving to the client side application and providing the functional requirements. OCEWCD exam is for the server side application developers, even though there are some client side JSP related topics.

The top level architecture of a web application can be visualized in the following manner. There can be one or more server and several clients access those servers simultaneously. If you are not familiar with the terms server and client, go through the following definitions which are taken form Wikipedia.
A server is a running instance of an application (software) capable of accepting requests from the client and giving responses accordingly. Servers can run on any computer including dedicated computers, which individually are also often referred to as “the server”. In many cases, a computer can provide several services and have several servers running. The advantage of running servers on a dedicated computer is security. For this reason most of the servers are daemon processes and designed in that they can be run on specific computer.

A client is a piece of computer hardware or software that accesses a service made available by a server. The server is often (but not always) on another computer system, in which case the client accesses the service by way of a network.

There are some more confusions regarding the servers. Sometimes people refer the computer which is running the server application as server. To avoid confusion I will refer them as hardware servers. The software component which is running in that computer is called as the server or server software. In the upcoming articles, if I mentioned anything just as server that refers the software component not the hardware system.

Server software is categorized into two major types, which are Web Servers (HTTP Servers) and Application Servers. Web server is a software component, which receives a request from any client and serve a static content to the client as the response. Web servers can serve only the static contents like HTML files and images, but they can forward the request to some other applications in case of any requests for dynamic content(Generated at the run-time completely or partially). Apache HTTP Server is the famous example for web server.
Application server is an application, which provides a set of components accessible to the software developer through an API. Currently almost all the application servers are available with a built in web server. For example JBoss is an application server which combines Apache HTTP Server to serve the HTTP requests.

In a typical web application, the web server first receives the request from client. If the request is for any static files, web server can return that file as the response. If it is for a dynamic content, then the request will be forwarded to the application server which can return the dynamic contents.

Wait we have even more…
There is another piece of software called Web container or Servlet container. Web container facilitates Java Servlets to serve the requests from clients (Servlets will be covered in the upcoming articles). Web container manages the life-cycle of Servlets, map any valid URL to Servlets and ensure the access privileges of Servlets. All the application servers contain a built in web container to handle the Servlets and JSPs. However there are some server applications, those are not a Java EE application servers but a combination of web server and Servlet container. Apache Tomcat and Jetty are the examples for these type of servers. The deference between these type of servers and application servers is, application server has full Java EE support but web container based servers does not. For example you can run an Enterprise Java Bean (EJB) application in an application server like JBoss, but not on Apache Tomcat. However you can run Servlet based applications on both of them.

Apache Tomcat has four major components. A Servlet container Catalina, a connector called Coyote which acts as a web server, Jasper, which is a JSP engine and a Cluster for load balancing purposes. Apache Tomcat can be used alone or with an additional HTTP server like Apache HTTP server.

For OCEWCD syllabus, students do not need to use any Java EE application servers like GlassFish or WildFly (An improved version of JBoss). Even though the application servers can run the Servlet applications, they are more advanced, need more resources and hard to configure. You can select either Tomcat or Jetty as your server and this series of articles is using Tomcat as the deployment server. These days, mostly the application servers and web containers are available with their built in web servers.

I do not want to write everything in a single post, so take a deep breath and relax yourself. In the next article, we will see the architecture of a web application.
Next Post »

Contact Form


Email *

Message *