Spring
许多 Java 团队已经使用 Spring Boot 来构建应用程序。Spring 与 webforJ 的集成现在允许您将 webforJ 的 UI 组件添加到现有的 Spring 应用程序中,或者在新的 webforJ 项目中使用 Spring 的功能。
您的 Spring 服务、仓库和配置照常工作。您的 webforJ 组件可以 @Autowired 任何 Spring bean。Spring Data 仓库通过 SpringDataRepository 直接连接到 webforJ 表。借助 live reload,开发速度更快,它会在您更改代码时刷新浏览器。
该集成让两个框架各司其职 - Spring 处理后端问题,而 webforJ 处理 UI。
Topics
Spring Boot
Generate a Spring Boot webforJ project with startforJ or Maven archetypes, or convert an existing WAR project to an embedded Tomcat JAR.
路由
Inject Spring services and repositories into webforJ @Route classes through constructor injection while keeping a fresh instance per navigation.
作用域
Use WebforjSessionScope, EnvironmentScope, and RouteScope to control bean lifetimes across sessions, browser tabs, and route hierarchies.
Spring Data JPA
Adapt Spring Data JPA repositories to webforJ Table and Repository components with SpringDataRepository, pagination, sorting, and Specifications.
后台任务
Run Spring @Async services from webforJ views and marshal progress and results back to the UI thread with Environment.runLater.
测试
Test a webforJ Spring Boot app without a browser with @SpringBootTest and @WebforjTest, with injected beans and Spring Security on routes.
继续学习
短短视频 · YouTubeTurn an invoice photo into Java data with AI
文章Starting a New Java Project: The Decisions That Shape the Stack
文章Your Spring Boot app doesn't need a REST API for the UI
文章React with a Java backend: when it fits, and the all-Java option
文章The best web framework for Java in 2026, by job
文章Struts to Spring Boot migration with webforJ
文章PrimeFaces alternative: rich Java components, no XHTML