Share
Embed
The Final Frontier of Web Development: React Server Components vs Jakarta EE
React Server Components allow you to write web user interfaces that can be rendered and optionally cached on the server. Sounds familiar?
It may be time to dust off the well-proven server-side rendering technologies on the Java side now that the JavaScript world seems to be catching up.
In this session, I will go through the benefits of server-side rendering and show how easy it is to do this with existing technologies in Java. Who knows, maybe I will get my hands dirty and demo some JavaScript as well for comparison.
ivargrimstad
May 17, 2024
Transcript
74 slides
-
The Final Frontier of Web Development React Server Components vs
Jakarta EE Ivar Grimstad Jakarta EE Developer Advocate Eclipse Foundation -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Why This Talk? -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Server Side Rendering Is HOT Again -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Disclaimer! -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Server Side Scripting {.js} Client Side Scripting -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Client Side Server Side -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) NOTE: No versus -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Nothing FINAL -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Web Development -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Client Side vs Server Side -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Client Side Rendering -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Browser Server Click Response Request JS -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Server Side Rendering -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Browser Server Click Response Request HTM HTM -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Advantages of Server Side Rendering -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Performance -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Initial Page Load -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Browser Server Click Response Request JS -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Caching -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Browser Server Click Response Request HTM HTM -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Data Fetching -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Browser Server Response Request -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Security -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Server Side Rendering Client Side Rendering Browser Server - API Keys - Data - Logic Security -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Search Engine Optimisation (SEO) -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Speci fi cation Document API TCK Final Speci fi cation Compatible Implementation(s) Speci fi -
Jakarta EE 10 Platform Updated Not Updated New Authorization 2.1
Activation 2.1 Batch 2.1 Connectors 2.1 Mail 2.1 Messaging 3.1 Enterprise Beans 4.0 RESTful Web Services 3.1 JSON Processing 2.1 JSON Binding 3.0 Annotations 2.1 CDI Lite 4.0 Interceptors 2.1 Dependency Injection 2.0 Servlet 6.0 Server Pages 3.1 Expression Language 5.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.0 WebSocket 2.1 Enterprise Beans Lite 4.0 Persistence 3.1 Transactions 2.0 Managed Beans 2.0 CDI 4.0 Authentication 3.0 Concurrency 3.0 Security 3.0 Bean Validation 3.0 -
RESTful Web Services 4.0 JSON Processing 2.1 JSON Binding 3.0
Annotations 3.0 CDI Lite 4.1 Interceptors 2.2 Dependency Injection 2.0 Servlet 6.1 Pages 4.0 Expression Language 6.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.1 WebSocket 2.2 Enterprise Beans Lite 4.0 Persistence 3.2 Transactions 2.0 CDI 4.1 Authentication 3.1 Concurrency 3.1 Security 4.0 Validation 3.1 Data 1.0 Authorization 3.0 Activation 2.1 Batch 2.1 Connectors 2.1 Mail 2.1 Messaging 3.1 Enterprise Beans 4.0 Jakarta EE 11 Platform Jakarta EE 11 Web Pro fi Updated Not Updated New -
Jakarta EE 11 Web Pro fi le RESTful Web Services
4.0 JSON Processing 2.1 JSON Binding 3.0 Annotations 3.0 CDI Lite 4.1 Interceptors 2.2 Dependency Injection 2.0 Servlet 6.1 Pages 4.0 Expression Language 6.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.1 WebSocket 2.2 Enterprise Beans Lite 4.0 Persistence 3.2 Transactions 2.0 CDI 4.1 Authentication 3.1 Concurrency 3.1 Security 4.0 Validation 3.1 Data 1.0 Jakarta EE 11 Core Pro fi Updated Not Updated New -
Jakarta EE 11 Core Pro fi le Updated Not Updated
New RESTful Web Services 4.0 JSON Processing 2.1 JSON Binding 3.0 Annotations 3.0 CDI Lite 4.1 Interceptors 2.2 Dependency Injection 2.0 -
Jakarta EE 11 Platform Updated Not Updated New Authorization 3.0
Activation 2.1 Batch 2.1 Connectors 2.1 Mail 2.1 Messaging 3.1 Enterprise Beans 4.0 RESTful Web Services 4.0 JSON Processing 2.1 JSON Binding 3.0 Annotations 3.0 CDI Lite 4.1 Interceptors 2.2 Dependency Injection 2.0 Servlet 6.1 Pages 4.0 Expression Language 6.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.1 WebSocket 2.2 Enterprise Beans Lite 4.0 Persistence 3.2 Transactions 2.0 CDI 4.1 Authentication 3.1 Concurrency 3.1 Security 4.0 Validation 3.1 Jakarta EE 11 Platform Updated Not Updated New Data 1.0 -
Jakarta EE 11 Platform Updated Not Updated New Authorization 3.0
Activation 2.1 Batch 2.1 Connectors 2.1 Mail 2.1 Messaging 3.1 Enterprise Beans 4.0 RESTful Web Services 4.0 JSON Processing 2.1 JSON Binding 3.0 Annotations 3.0 CDI Lite 4.1 Interceptors 2.2 Dependency Injection 2.0 Servlet 6.1 Pages 4.0 Expression Language 6.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.1 WebSocket 2.2 Enterprise Beans Lite 4.0 Persistence 3.2 Transactions 2.0 CDI 4.1 Authentication 3.1 Concurrency 3.1 Security 4.0 Validation 3.1 Jakarta EE 11 Platform Updated Not Updated New Data 1.0 -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Jakarta Pages (JSP) DEMO -
<!DOCTYPE html> <html> <head> <title>EJS Demo</title> </head> <body> <h1>EJS Demo</h1>
<% if(true){ %> <h4>Greetings from GeeCON 2024</h4> <% } %> </body> </html> -
<%@ page contentType="text/html;charset=UTF-8" language=“java" %> <html> <head> <title>JSP Demo</title> </head>
<body> <h1>JSP Demo</h1> <% if(true){ %> <h4>Greetings from GeeCON 2024</h4> <% } %> </body> </html> -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Jakarta Pages 4.0 https://jakarta.ee/speci fi cations/pages/4.0/ -
Jakarta EE 11 Platform Updated Not Updated New Authorization 3.0
Activation 2.1 Batch 2.1 Connectors 2.1 Mail 2.1 Messaging 3.1 Enterprise Beans 4.0 RESTful Web Services 4.0 JSON Processing 2.1 JSON Binding 3.0 Annotations 3.0 CDI Lite 4.1 Interceptors 2.2 Dependency Injection 2.0 Servlet 6.1 Pages 4.0 Expression Language 6.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.1 WebSocket 2.2 Enterprise Beans Lite 4.0 Persistence 3.2 Transactions 2.0 CDI 4.1 Authentication 3.1 Concurrency 3.1 Security 4.0 Validation 3.1 Jakarta EE 11 Platform Updated Not Updated New Data 1.0 -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Jakarta Servlet DEMO -
@Override protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
resp.getWriter().println("<h1>Hello World!</h1>“); } -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Jakarta Servlet 6.1 https://jakarta.ee/speci fi cations/servlet/6.1/ -
Jakarta EE 11 Platform Updated Not Updated New Authorization 3.0
Activation 2.1 Batch 2.1 Connectors 2.1 Mail 2.1 Messaging 3.1 Enterprise Beans 4.0 RESTful Web Services 4.0 JSON Processing 2.1 JSON Binding 3.0 Annotations 3.0 CDI Lite 4.1 Interceptors 2.2 Dependency Injection 2.0 Servlet 6.1 Pages 4.0 Expression Language 6.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.1 WebSocket 2.2 Enterprise Beans Lite 4.0 Persistence 3.2 Transactions 2.0 CDI 4.1 Authentication 3.1 Concurrency 3.1 Security 4.0 Validation 3.1 Jakarta EE 11 Platform Updated Not Updated New Data 1.0 -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Jakarta Faces (JSF) DEMO -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Jakarta Faces 4.1 https://jakarta.ee/speci fi cations/faces/4.1/ -
Jakarta EE 11 Platform Updated Not Updated New Authorization 3.0
Activation 2.1 Batch 2.1 Connectors 2.1 Mail 2.1 Messaging 3.1 Enterprise Beans 4.0 RESTful Web Services 4.0 JSON Processing 2.1 JSON Binding 3.0 Annotations 3.0 CDI Lite 4.1 Interceptors 2.2 Dependency Injection 2.0 Servlet 6.1 Pages 4.0 Expression Language 6.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.1 WebSocket 2.2 Enterprise Beans Lite 4.0 Persistence 3.2 Transactions 2.0 CDI 4.1 Authentication 3.1 Concurrency 3.1 Security 4.0 Validation 3.1 Jakarta EE 11 Platform Updated Not Updated New Data 1.0 MVC 3.0 -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Jakarta MVC DEMO -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) + -
public class HtmxViewEngine implements ViewEngine { boolean supports(String view) {
// TODO:implement } void processView(ViewEngineContext ctx) throws ViewEngineException { // TODO:implement } } -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Jakarta MVC Standardizes the action-based model-view-controller pattern https://jakarta.ee/speci fi cations/mvc/ -
COPYRIGHT (C) 2022, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Summary -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) Server Side Rendering Is HOT Again -
Jakarta EE 10 Platform Updated Not Updated New Authorization 2.1
Activation 2.1 Batch 2.1 Connectors 2.1 Mail 2.1 Messaging 3.1 Enterprise Beans 4.0 RESTful Web Services 3.1 JSON Processing 2.1 JSON Binding 3.0 Annotations 2.1 CDI Lite 4.0 Interceptors 2.1 Dependency Injection 2.0 Servlet 6.0 Server Pages 3.1 Expression Language 5.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.0 WebSocket 2.1 Enterprise Beans Lite 4.0 Persistence 3.1 Transactions 2.0 Managed Beans 2.0 CDI 4.0 Authentication 3.0 Concurrency 3.0 Security 3.0 Bean Validation 3.0 -
Authorization 3.0 Activation 2.1 Batch 2.1 Connectors 2.1 Mail 2.1
Messaging 3.1 Enterprise Beans 4.0 RESTful Web Services 4.0 JSON Processing 2.1 JSON Binding 3.0 Annotations 3.0 CDI Lite 4.1 Interceptors 2.2 Dependency Injection 2.0 Servlet 6.1 Pages 4.0 Expression Language 6.0 Debugging Support 2.0 Standard Tag Libraries 3.0 Faces 4.1 WebSocket 2.2 Enterprise Beans Lite 4.0 Persistence 3.2 Transactions 2.0 CDI 4.1 Authentication 3.1 Concurrency 3.1 Security 4.0 Validation 3.1 Jakarta EE 11 Platform Updated Not Updated New Data 1.0 Com ing This July -
COPYRIGHT (C) 2024, ECLIPSE FOUNDATION, INC. | THIS WORK IS
LICENSED UNDER A CREATIVE COMMONS ATTRIBUTION 4.0 INTERNATIONAL LICENSE (CC BY 4.0) 2022 2024 2020 Java 21 Embrace Records Jakarta Data CDI Centric Removals and Deprecations javax.* -> jakarta.* Jakarta EE Core Pro fi le -
Jakarta EE https://jakarta.ee Get Started https://start.jakarta.ee Ivar’s Hashtag Jakarta EE
https://www.agilejava.eu/category/jakarta-ee/ Demo Code https://github.com/ivargrimstad/dukes-server- components