React SSR system for a legacy Java/JSP site
A React SSR system added to a legacy Java/JSP website (Java code from 2006) at a bird conservation non-profit. It renders HTML from Java via a Node subprocess communicating over stdin/stdout, includes a Node/Vite proxy server that provides SPA-style HMR, supports multiple React roots per page by hydrating elements marked with data-props and data-componentname attributes, and packages the Node renderer script as an EXE deployed in WEB-INF on the server.
What it addresses
The workplace website runs on old Java code from 2006 with many JSP files, and needed modern React tooling without a framework like NextJS.
Shared over time
Each entry reflects what was shared on that date. Details may have changed since then.
React SSR system for a legacy Java/JSP site
A React SSR system added to a legacy Java/JSP website (Java code from 2006) at a bird conservation non-profit. It renders HTML from Java via a Node subprocess communicating over stdin/stdout, includes a Node/Vite proxy server that provides SPA-style HMR, supports multiple React roots per page by hydrating elements marked with data-props and data-componentname attributes, and packages the Node renderer script as an EXE deployed in WEB-INF on the server.
Problem: The workplace website runs on old Java code from 2006 with many JSP files, and needed modern React tooling without a framework like NextJS.
Posted by @srcreigh · Original source ↗
Source text · @srcreigh · · Source ↗
I've added a react SSR system. It has node subprocess code for rendering HTML from java via stdin/stdout. There's a Node/Vite proxy server that adds the fancy HMR you expect from SPA apps.