Spring Framework
Many Java teams already use Spring Boot for building applications. Spring integration with webforJ now lets you add webforJ's UI components to existing Spring applications, or use Spring's features in new webforJ projects.
Your Spring services, repositories, and configuration work as normal. Your webforJ components can @Autowired
any Spring bean. Spring Data repositories connect directly to webforJ tables through SpringDataRepository
. Development gets faster with automatic browser refresh from Spring DevTools and webforJ LiveReload.
The integration keeps both frameworks doing what they do best - Spring handles backend concerns while webforJ handles the UI.
Topics
📄️ Spring Boot
Spring Boot is a popular choice for building Java apps, providing dependency injection, auto-configuration, and an embedded server model. When using Spring Boot with webforJ, you can inject services, repositories, and other Spring-managed beans directly into your UI components through constructor injection.
📄️ Routing
Routing in webforJ with Spring works exactly the same way as in plain webforJ applications. You still use the @Route annotation to define routes, the same navigation patterns, and the same route lifecycle. The only difference is that when Spring is present, your routes can also receive Spring beans through constructor injection.
📄️ Scopes
Spring manages bean lifecycle through scopes. Each scope defines when a bean is created, how long it lives, and when it's destroyed. webforJ adds two custom scopes - @EnvironmentScope and @RouteScope - that map to how webforJ applications handle browser sessions and navigation.
📄️ Spring Data JPA
Spring Data JPA is the de facto standard for data access in Spring applications, providing repository abstractions, query methods, and specifications for complex queries. The webforJ SpringDataRepository adapter bridges Spring Data repositories with webforJ's UI components, enabling you to bind JPA entities directly to UI components, implement dynamic filtering with JPA Specifications, and handle pagination.
📄️ Background Jobs
When users click a button to generate a report or process data, they expect the interface to remain responsive. Progress bars should animate, buttons should react to hover, and the app shouldn't freeze. Spring's @Async annotation makes this possible by moving long-running operations to background threads.
📄️ Spring DevTools
Spring DevTools provides automatic app restarts when code changes. webforJ DevTools adds automatic browser refresh - when Spring restarts your app, the browser refreshes automatically through webforJ's LiveReload server.