Slide 1

Slide 1 text

Current State of Java Web Frameworks 2025-09-19 JCConf 2025 LY Corporation, NAOKI KISHIDA

Slide 2

Slide 2 text

2025/09/30 2 About me ● Naoki Kishida ● Fukuoka, Japan ● LY Corporation ● X(Twitter): @kis ● blog: kishida's Hatena ● (nowokay.hatenablog.com) ● Java beginners book titled "Becoming Professional in Java"

Slide 3

Slide 3 text

2025/09/30 3 Agenda ● Processes in web servers ● Types of Web Frameworks ● Evolution of Web Frameworks ● How about the java standards?

Slide 4

Slide 4 text

2025/09/30 4 What is a Web framework? ● A framework in web application server-side development that abstracts web technology details to enable developers to focus on application processing

Slide 5

Slide 5 text

Processes in web servers ● Simple Web server ● Frameworks are a mechanism that enables the separation and extension of application-specific components from such web servers. void main() throws Exception{ var server = new ServerSocket(8080); for (;;) { var soc = server.accept(); Thread.ofVirtual().start(() -> { try (soc; var isr = new InputStreamReader(soc.getInputStream()); var bur = new BufferedReader(isr); var w = new PrintWriter(soc.getOutputStream())) { // Parse header var line = bur.readLine(); if (line == null) return; // exit thread IO.println("Connect from %s for %s".formatted(soc.getInetAddress(), line)); while (!bur.readLine().isEmpty()) {} // Process routing by URL var url = line.split(" ")[1]; var message = switch(url) { case "/hello" -> "Hello!!!"; case "/date" -> LocalDate.now(); default -> "It works!"; }; // Output header w.println(""" HTTP/1.1 200 OK content-type: text/html """); w.println(); // Output content w.println(""" Hello

Hello

%s """.formatted(message)); } catch (IOException ex) { throw new UncheckedIOException(ex); } }); } }

Slide 6

Slide 6 text

Required processes for web development ● HTTP Processing ● Request Handling ● Routing ● Response Handling ● Web Application Processing ● Sessions ● Authentication / Authorization ● Resource Management ● Server Management ● Network Management ● Execution Management ● Configurations ● Monitoring ● Development Management ● Build ● Deployments ● Tests

Slide 7

Slide 7 text

Required processes for web development ● HTTP Processing ● Request Handling ● Routing ● Response Handling ● Web Application Processing ● Sessions ● Authentication / Authorization ● Resource Management ● Server Management ● Network Management ● Execution Management ● Configurations ● Monitoring ● Development Management ● Build ● Deployments ● Tests

Slide 8

Slide 8 text

Required processes for web development ● HTTP Processing ● Request Handling ● Routing ● Response Handling ● Web Application Processing ● Sessions ● Authentication / Authorization ● Resource Management ● Server Management ● Network Management ● Execution Management ● Configurations ● Monitoring ● Development Management ● Build ● Deployments ● Tests

Slide 9

Slide 9 text

Required processes for web development ● HTTP Processing ● Request Handling ● Routing ● Response Handling ● Web Application Processing ● Sessions ● Authentication / Authorization ● Resource Management ● Server Management ● Network Management ● Execution Management ● Configurations ● Monitoring ● Development Management ● Build ● Deployments ● Tests

Slide 10

Slide 10 text

Required processes for web development ● HTTP Processing ● Request Handling ● Routing ● Response Handling ● Web Application Processing ● Sessions ● Authentication / Authorization ● Resource Management ● Server Management ● Network Management ● Execution Management ● Configurations ● Monitoring ● Development Management ● Build ● Deployments ● Tests

Slide 11

Slide 11 text

● HTTP Processing ● Request Handling ● Routing ● Response Handling ● Web Application Processing ● Sessions ● Authentication / Authorization ● Resource Management ● Server Management ● Network Management ● Execution Management ● Configurations ● Monitoring ● Development Management ● Build ● Deployments ● Tests Required processes for web development var server = new ServerSocket(8080); for (;;) { var ip = socket.remoteAddress;

Slide 12

Slide 12 text

● HTTP Processing ● Request Handling ● Routing ● Response Handling ● Web Application Processing ● Sessions ● Authentication / Authorization ● Resource Management ● Server Management ● Network Management ● Execution Management ● Configurations ● Monitoring ● Development Management ● Build ● Deployments ● Tests Required processes for web development Thread.ofVirtual().start(() -> {

Slide 13

Slide 13 text

● HTTP Processing ● Request Handling ● Routing ● Response Handling ● Web Application Processing ● Sessions ● Authentication / Authorization ● Resource Management ● Server Management ● Network Management ● Execution Management ● Configurations ● Monitoring ● Development Management ● Build ● Deployments ● Tests Required processes for web development //Ideally, enable to configure the port number. var server = new ServerSocket(8080);

Slide 14

Slide 14 text

● HTTP Processing ● Request Handling ● Routing ● Response Handling ● Web Application Processing ● Sessions ● Authentication / Authorization ● Resource Management ● Server Management ● Network Management ● Execution Management ● Configurations ● Monitoring ● Development Management ● Build ● Deployments ● Tests Required processes for web development IO.println("Connect from %s for %s".formatted(soc.getInetAddress(), line)); } catch (IOException ex) { throw new UncheckedIOException(ex); }

Slide 15

Slide 15 text

● HTTP Processing ● Request Handling ● Routing ● Response Handling ● Web Application Processing ● Sessions ● Authentication / Authorization ● Resource Management ● Server Management ● Network Management ● Execution Management ● Configurations ● Monitoring ● Development Management ● Build ● Deployments ● Tests Required processes for web development // Parse headers var line = bur.readLine(); if (line == null) return; // exit thread IO.println("Connect from %s for %s".formatted(soc.getInetAddress(), line)); while (!bur.readLine().isEmpty()) {}

Slide 16

Slide 16 text

● HTTP Processing ● Request Handling ● Routing ● Response Handling ● Web Application Processing ● Sessions ● Authentication / Authorization ● Resource Management ● Server Management ● Network Management ● Execution Management ● Configurations ● Monitoring ● Development Management ● Build ● Deployments ● Tests Required processes for web development // URL-based routing var url = line.split(" ")[1]; var message = switch(url) { case "/hello" -> "Hello!!!"; case "/date" -> LocalDate.now(); default -> "It works!"; };

Slide 17

Slide 17 text

● HTTP Processing ● Request Handling ● Routing ● Response Handling ● Web Application Processing ● Sessions ● Authentication / Authorization ● Resource Management ● Server Management ● Network Management ● Execution Management ● Configurations ● Monitoring ● Development Management ● Build ● Deployments ● Tests Required processes for web development // Output headers w.println(""" HTTP/1.1 200 OK content-type: text/html """); w.println(); // Output contents w.println(""" Hello

Hello

%s """.formatted(message));

Slide 18

Slide 18 text

Required processes for web development ● HTTP Processing ● Request Handling ● Routing ● Response Handling ● Web Application Processing ● Sessions ● Authentication / Authorization ● Resource Management ● Server Management ● Network Management ● Execution Management ● Configurations ● Monitoring ● Development Management ● Build ● Deployments ● Tests

Slide 19

Slide 19 text

19 Types of Web Frameworks ● performs HTTP processing ● make the part easier to write ● Three types of frameworks ● Declarative Form ● Imperative Form ● Component-based Form var message = switch(url) { case "/hello" -> "Hello!!!"; case "/date" -> LocalDate.now(); default -> "It works!"; };

Slide 20

Slide 20 text

Declarative Form ● Configures declaratively using annotations. It is mainstream. ● Spring Web ● JAX-RS ● in Jakarta EE, “Jakarta RESTful Web Services” with no abbreviation ● Micronaut ● Servlet

Slide 21

Slide 21 text

Declarative Form ● roughly similar (same code except annotations) import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; @RestController public class HelloController { @GetMapping(value = "/hello", produces = "text/plain") public String hello() { return "Hello Spring Boot!!"; } } import jakarta.ws.rs.*; import jakarta.ws.rs.core.MediaType; @Path("/hello") public class HelloController { @GET @Produces(MediaType.TEXT_PLAIN) public String hello() { return "Hello JAX-RS!!"; } } import io.micronaut.http.MediaType; import io.micronaut.http.annotation.*; @Controller("/hello") public class HelloController { @Get @Produces(MediaType.TEXT_PLAIN) public String hello() { return "Hello Micronaut!!"; } }

Slide 22

Slide 22 text

Imperative Form ● Configure routing and processing in a imperative manner ● Javalin ● Helidon SE ● roughly similar import io.helidon.webserver.WebServer; void main() { WebServer.builder() .port(8080) .routing(b -> b.get("/hello", (req, res) -> res.send("Hello Helidon!")) .get("/date", (req, res) -> res.send(LocalDate.now().toString())) .get("/*", (req, res) -> res.send("It Works!"))) .build().start(); } import io.javalin.Javalin; void main() { Javalin.create() .get("/hello", ctx -> ctx.result("Hello Javalin!")) .get("/date", ctx -> ctx.result(LocalDate.now().toString())) .get("/*", ctx -> ctx.result("It works!!")) .start(8080); }

Slide 23

Slide 23 text

Component-based Form ● UI component that combines client and server processing assembling ● Implemented solely on the server side engineer including UI ● Distinctive for each ● JSF ● ZK ● Vaadin ● Companys are sustained by a paid component.

Slide 24

Slide 24 text

JSF ● Java EE / Jakarta EE standards ● Jakarta Faces

Slide 25

Slide 25 text

● Java + Facelets(XHTML) ● Java codes are POJO ● have a peculiar control method
JSF import jakarta.enterprise.context.RequestScoped; import jakarta.inject.Named; @Named @RequestScoped public class HelloBean { // Need setter and getter for the fields private String message = "Hello!!!"; private String input = ""; public void go() { message = "hello " + input; } }

Slide 26

Slide 26 text

public class HelloComposer extends SelectorComposer{ @Wire private Label output; @Wire private Textbox input; @Listen("onClick = #exec") public void go() { output.setValue(input.getValue()); } } ZK ● Java + ZUL(XML) ● Manage Component Models in Java It works!!

Slide 27

Slide 27 text

@Component @Route("") public class MainView extends VerticalLayout{ public MainView() { TextField textField = new TextField("Enter text"); Span label = new Span("Hello"); Button button = new Button("Go"); button.addClickListener(e -> label.setText(textField.getValue())); add(textField, button, label); } } Vaadin ● Write entirely in Java, like Swing

Slide 28

Slide 28 text

Evolution of Web Frameworks ● Servlet container ● Embedded Servers ● Docker ● Serverless

Slide 29

Slide 29 text

Servlet Container ● Deploy the application to application server called a servlet container ● Due to the computer's low performance, multiple applications were run on one server process (with main RAM of 128MB or such). ● Frameworks that started from Struts are wrappers of servlets ● Process just only HTTP. Servlet mechanisms are used for Auth or Session ● Development and Operation are troublesome ● Require deployment ● Require Tomcat installed

Slide 30

Slide 30 text

Rise of Cloud computing ● Supply side ● Multi-server adoption due to performance plateau in threading ● Demand-side ● Increased traffic from 4G and Smartphones

Slide 31

Slide 31 text

Servlet Containers are unsuited for Cloud ● Running a single web application across multiple servers for scale-out ● App server installation and deployment just make development more troublesome

Slide 32

Slide 32 text

Embedded Server ● Embedded Server in Spring Boot ● Launch Tomcat from the `main` method ● Deploy the application internally ● Full Stack Frameworks

Slide 33

Slide 33 text

Build diversity through server embedding ● Changes from WAR single option ● fat-jar (all required jar included) ● JVM integrated package ● Containerized with Docker ● Native Compile

Slide 34

Slide 34 text

Docker and Microservices ● Further multi-core processors ● Using too many Hypervisor-based VM is wasteful ● Emergence of containers that only virtualize OS resources like process IDs ● Enables flexible operation of server processes. ● Separate servers by function to allocate more server resources to high-load functions ● Microservices

Slide 35

Slide 35 text

Startup time and Resilience ● Startup speed is an issue for JVM , Servlets and Spring DI. ● Quarkus and Micronaut solves by independent of servlets and compile-time DI ● Resilience, flexibility during failures is also important. ● Operations assuming failure will occur

Slide 36

Slide 36 text

Serverless and Native Image ● Split the microservices by function, each request handler is isolated into a single process ● Serverless ● Cloud-native CGI

Slide 37

Slide 37 text

JIT Optimization timing matters ● Not only the JVM startup time but also JIT optimization timing matters ● Handling a single request, the process terminates before JIT compilation. ● Native compilation with GraalVM ● Standardized in Project Leyden (JEP 483 in Java 24, JEP 515 in Java 25)

Slide 38

Slide 38 text

How about the Java standards? ● The Decline of Java EE ● Java EE Guardians and Jakarta EE ● MicroProfile ● Jakarta EE 11

Slide 39

Slide 39 text

The Decline of Java EE ● The Java EE model of deploying numerous applications to a single application server didn't work well in the cloud. ● The Java EE 7 release in 2013 wasn't truly cloud-ready. ● and development on Java EE 8 continued stagnating. ● Advanced features of Java EE application servers replaced by Kubernetes ● The strengths of Java EE are eroding.

Slide 40

Slide 40 text

Java EE Guardians and Jakarta EE ● Dissatisfaction with Oracle's lack of progress on Java EE 8 led to the launch of the Java EE Guardians in 2016. ● Transferred to Eclipse Foundation in 2017 with the release of Java EE 8. ● Because the name “Java” can no longer be used, the name changed into Jakarta EE

Slide 41

Slide 41 text

MicroProfile ● Even when expectations for Java EE's cloud-compatibility - especially its microservices support - were uncertain, strong demand existed, leading to the formulation of MicroProfile in 2016 by members also participating in the Java EE Guardians initiative. ● Focuses on monitoring and fault tolerance ● Based on Jakarta EE Core Profile ● Servlet independent

Slide 42

Slide 42 text

APIs in MicroProfile ● Telemetry ● Server state retrieval and provisioning ● Open API ● API Specification Description ● REST Client ● API calling ● Config ● Settings ● Fault Tolerance ● Timeout / Retry / Circuit Breaker ● JWT Authentication ● Authentication byJSON Web Token ● Health ● Application availability check

Slide 43

Slide 43 text

Jakarta EE 11 ● Released in June 2025 ● Require Java 17 ● Record is supported ● Virtual thread is supported.

Slide 44

Slide 44 text

MCP Server ● MCP – remote tools assuming to be invoked from LLMs ● JSON-RPC based remote object ● Spring Boot and Quarkus are supports MCP

Slide 45

Slide 45 text

MCP Server ● Roughly same ● For Spring boot ● @Tool and @ToolParam ● For Quarkus ● @Tool and @ToolArg @Service public class WeatherTool { @Tool(description = "Get the location’s weather ") String getWeather( @ToolParam(description = "The location") String location) { if ("taipei".equalsIgnoreCase(location)) { return "fine"; } else { return "rain"; } } }

Slide 46

Slide 46 text

Summary ● Understanding how web frameworks fit into the larger programming context helps make them easier to manage. ● Knowing the evolusion history makes the function's meaning clearer. ● Understand the components needed for an application from the framework’s features

Slide 47

Slide 47 text

Thank You