If Java web application is a cup of coffee, Espresso is its soul

Introducing Espresso, a core web abstraction for Java – The future of Java web ecosystem?

Eirini-Eleni Papadopoulou
© Shutterstock / Sergey Nivens  

Things have been evolving pretty rapidly in the Java ecosystem, however, there is a part of this ecosystem that is still lagging behind: web Java. Today, we have a look at a new Java tool that aspires to become the soul of modern Java web application! Meet Espresso, a core web abstraction for Java.

One of the things that never bore us is covering new and interesting Java tools! Today, we have a core web abstraction for Java, called Espresso that aspires to become the soul of modern Java web application!

As Java has been experiencing a more intense cycle of innovation with the new release cadence, it’s not unusual to see the development of the Java ecosystem as well as the language itself move a lot faster lately.

However, there’s still a part of the Java ecosystem that is arguably underdeveloped and that is web Java. As Ning Sun, the creator of Espresso argued, the Servlet API is outdated, heavy, and verbose and even though Spring Boot has improved Java development, a simpler abstraction like Python’s WSGI would still be the preferred choice.

SEE ALSO: Testcontainers is a lightweight Java library for anything that can run in a Docker container

And that was the main motivation behind the creation of Espresso!

Espresso is heavily inspired by Clojure’s Ring and Rust’s Iron and it is accompanied by three micro-libraries that support it, namely:

  • Jettino: An espresso adapter for Jetty
  • Latte: URL router for Espresso
  • Sugar: parameter extractor

The key concepts of the espresso ecosystem include:

  • App: Espresso function implementation.
  • Server: A container to run espresso function.
  • Adapter: A adapter layer for existed Java web server to run espresso function.
  • Plugin or Middleware: An espresso function wrapper that provides additional features or data to core espresso function.

This is how a ‘hello world’ web application with espresso can look like:

import io.github.espresso4j.espresso.*;
import io.github.espresso4j.jettino.Jettino;

public class App {

    public static void main(String[] args) throws Exception {
        new Jettino().start((req) -> Response.of(200).body("It works."));


Getting started

You can find a simple demo here that you can run with gradle run.

You can also find the libraries published on Maven central.

Eirini-Eleni Papadopoulou
Eirini-Eleni Papadopoulou was the editor for Coming from an academic background in East Asian Studies, she decided that it was time to go back to her high-school hobby that was computer science and she dived into the development world. Other hobbies include esports and League of Legends, although she never managed to escape elo hell (yet), and she is a guest writer/analyst for competitive LoL at TGH.

Inline Feedbacks
View all comments