Chapter 13
Creating Web Applications
This chapter covers Tomcat and Jetty, two of the main applications used to serve web pages, and it also covers a more recent framework, Play. Both Tomcat and Jetty implement the Java Servlet API. This API is part of Java Enterprise Edition, a platform covering many applications and services often used in developing software for the enterprise. As well as the Servlet API, this includes topics such as Java’s Messaging Service and some advanced topics around database transaction management and persistence.
Tomcat and Jetty are quite similar, in that they both follow the Servlet API. In fact, some teams often use both within their development cycle for creating a single application: using Jetty for active day-to-day development, and using Tomcat for deployment for use with multiple users, whether that’s a QA for testing or live production deployment.
The relevant sections in this chapter try to differentiate between Tomcat and Jetty, and where they can be appropriately used.
Play is a newer application server inspired by other frameworks, such as Rails, that concentrates on rapid prototyping and fast development, iterating development on top of a barebones, but functional, application.
Tomcat and the Servlet API
Java’s Servlet API defines a set of interfaces and file definitions for building web applications for use on the JVM.
How are web applications defined within the Servlet API?
The Servlet API defines that a web application uses a
Get Java Programming Interviews Exposed now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.