Go further
Configuration
A small set of application-level choices for rendering, transports, page lifetime, and styling.
Browse documentation
Configure the runtime
Jaspring uses Spring Boot configuration properties under jaspring. Enable virtual threads for the application. Use dev-mode during development when you want detailed handler errors returned to the browser.
spring:
threads:
virtual:
enabled: true
jaspring:
change-detection: zone
live:
transport: websocket
stability-timeout: 10s
page-ttl: 60s
max-pages-per-session: 20
dev-mode: false
Page lifetime and stability
stability-timeout controls how long the initial render waits for Zone-managed work. Later completions arrive as patches. It defaults to ten seconds. A lower timeout can expose a loading state sooner.
page-ttl is how long a page survives without a connected client, defaulting to sixty seconds. max-pages-per-session defaults to twenty. Each live page owns server-side state, so choose deployment capacity with that lifetime in mind.
Layout and component discovery
The default layout is classpath:/jaspring/index.html. Add that resource to customize the document head, fonts, global CSS, and scripts. Include an empty root-selector element; Jaspring replaces it with rendered component HTML.
Component discovery defaults to the @SpringBootApplication packages. Set jaspring.base-packages when components live elsewhere.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>My Jaspring app</title>
<link rel="stylesheet" href="/site.css">
</head>
<body><app-root></app-root></body>
</html>
Opt into Tailwind
Set jaspring.tailwind.stylesheet to a classpath CSS resource to enable Tailwind’s startup compilation. Without this property, ordinary global and component styles work without Tailwind.
jaspring:
tailwind:
stylesheet: classpath:tailwind.css