Java architectures #5 – Web Containers (Servlets/Jsp)

One of the most popular Java servers are “Web Containers”, lightweight application server that implement Java Servlet Specification [1][2] and others like JavaServer Pages (JSP), Expression Language (EL) and Standard Tag Library (JSTL).

Web Containers don’t implement the full J2EE specification, most cases don’t support EJB or SOAP webservices out of the box, on the other hand they’re are extremely simple and easy to use, what make them a common choice for Java Web development.

Java servlet detail [4]

The Apache Tomcat [3] with its initial release in 1999 was the first available in the market, more recently Jetty became also popular.

Java Servlets are a low level API and not very suitable for modern application programming, they’re bundled presentation like JSP or Velocity, later they became the base for Web frameworks as Struts, JSF or Spring MVC.

JSP are itself an high-level abstraction of Java Servlets and can be used independently, it’s more basic model a JSP can be invoked directly from the client, the so called Model 1 [5]

Model 1

The successor Model 2 makes a separation between the design and the content itself, in a similar fashion to the Model View Controller (MVC) model.[6]

Model 2

Apache Tomcat

Apache Tomcat Servlet/JSP container is a very well know Java platform, that is very easy to install and to use compering with the fully fledged J2EE Application Servers, however it doesn’t come without its drawbacks and lacks configuration and management features and relies frequently on external modules to add extra functionalities.

Despite its shortcomings, end up to be the first choice for small to medium web application as a affordable option to more complex and cumbersome Application Servers like JBoss or Glassfish.

[1]https://en.wikipedia.org/wiki/Java_servlet

[2] https://jcp.org/aboutJava/communityprocess/first/jsr154/index3.html

[3]https://en.wikipedia.org/wiki/Apache_Tomcat

[4] https://www.javaworld.com/article/3313114/what-is-a-java-servlet-request-handling-for-java-web-applications.html

[5] https://en.wikipedia.org/wiki/JSP_model_1_architecture

[6] https://en.wikipedia.org/wiki/JSP_model_2_architecture