Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Current States of Java Web Frameworks at JCConf...

Current States of Java Web Frameworks at JCConf 2025

Presentation material for JCConf 2025 on Sep. 19, 2025
https://jcconf.tw/2025/

Avatar for Naoki Kishida

Naoki Kishida

September 19, 2025
Tweet

More Decks by Naoki Kishida

Other Decks in Programming

Transcript

  1. 2025/09/19 2 About me • Naoki Kishida • Fukuoka, Japan

    • LINE Yahoo • X(Twitter): @kis • blog: kishida's Hatena • (nowokay.hatenablog.com) • Java beginners book titled "Becoming Professional in Java"
  2. 2025/09/19 3 Agenda • Processes in web servers • Types

    of Web Frameworks • Evolution of Web Frameworks • How about the java standards?
  3. 2025/09/19 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
  4. 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(""" <html><head><title>Hello</title></head> <body><h1>Hello</h1>%s</body></html> """.formatted(message)); } catch (IOException ex) { throw new UncheckedIOException(ex); } }); } }
  5. 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
  6. • 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;
  7. • 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(() -> {
  8. • 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);
  9. • 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); }
  10. • 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()) {}
  11. • 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!"; };
  12. • 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(""" <html><head><title>Hello</title></head> <body><h1>Hello</h1>%s</body></html> """.formatted(message));
  13. 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
  14. 15 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!"; };
  15. 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
  16. 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!!"; } }
  17. 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); }
  18. 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.
  19. • Java + Facelets(XHTML) • Java codes are POJO •

    have a peculiar control method <f:view> <h:form> <div> <h:inputText id="in" value="#{helloBean.input}"/> <h:commandButton value="Hello" actionListener="#{helloBean.go()}"> <f:ajax execute="in" render="out"/> </h:commandButton> </div> <h:outputLabel id="out" value="#{helloBean.message}"/> </h:form> </f:view> 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; } }
  20. public class HelloComposer extends SelectorComposer<Component>{ @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 <zk> <window title="My Page" border="normal" apply="com.example.demo.HelloComposer"> It works!! <vlayout> <hlayout> <textbox id="input"/> <button id="exec" label="Go"/> </hlayout> <label id="output" value="hello"/> </vlayout> </window> </zk>
  21. @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
  22. 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
  23. Embedded Server • The Rise of Cloud Computing • Supply

    side: Multi-server adoption due to performance plateau in threading • Demand-side: Increased traffic from 4G and Smartphones • Running a single web application across multiple servers for scale-out • Servlet Container Incompatible • App server installation and deployment is just makes development complicated • Embedded Server in Spring Boot • Full Stack Frameworks
  24. Build diversity through server embedding • Changes from WAR single

    option • fat-jar (all required jar included) • JVM integrated package • Containerized with Docker • Native Compile
  25. 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 • 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
  26. Serverless and Native Image • Split the microservices by function,

    each request handler is isolated into a single process • Serverless • Cloud-native CGI • 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)
  27. How about the Java standards? • The Decline of Java

    EE • Java EE Guardians and Jakarta EE • MicroProfile • Jakarta EE 11
  28. 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.
  29. 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
  30. 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
  31. 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
  32. Jakarta EE 11 • Released in June 2025 • Require

    Java 17 • Record is supported • Virtual thread is supported.
  33. MCP Server • MCP – remote tools assuming to be

    invoked from LLMs • JSON-RPC based remote object • Spring Boot and Quarkus are supports MCP
  34. 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"; } } }
  35. 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