How do you implement template layouts in Thymeleaf?
Build a base layout with layout:fragment, decorate pages with layout:decorate, and share headers and footers with th:replace in a Spring Boot app.
2,881 posts about Java: questions with answers, tutorials and articles, newest first.
Build a base layout with layout:fragment, decorate pages with layout:decorate, and share headers and footers with th:replace in a Spring Boot app.
In a Thymeleaf app, @Controller maps requests, fills the Model and returns template names. See examples, form handling and how it differs from @RestController.
Set up Spring Boot with Thymeleaf step by step, from the starter dependency to controllers, templates, form validation and shared layout fragments.
HttpSession keeps per-user state across HTTP requests in Jakarta Servlet apps. See how it works, its methods and how to secure it.
Work with HttpSession in Spring MVC: create, read and invalidate sessions, configure timeout and cookies, use session-scoped beans and listeners.
@Valid triggers Bean Validation on Spring controller arguments. See form and JSON examples, nested validation and error handling with jakarta.validation.
Validate Spring MVC forms with Jakarta constraints, @Valid and BindingResult, show errors in Thymeleaf, and add custom or cross-field rules.
Accept uploads in Spring MVC with MultipartFile and a multipart form, then validate, rename and store files safely with Spring Boot 3 and Thymeleaf.
Handle forms in Spring MVC with a form object, @ModelAttribute binding, Jakarta validation, BindingResult and the Post/Redirect/Get pattern.
Build a REST API with Spring MVC and Spring Boot 3 using @RestController, verb mappings, validation, ProblemDetail errors and curl examples.
There is no standard @SecurityRole in Java or Jakarta EE. Role-based access uses @DeclareRoles, @RolesAllowed, @PermitAll and security-role entries in web.xml.
How to secure Enterprise JavaBeans in Jakarta EE: container authentication, role-based method access, programmatic checks, @RunAs and descriptor permissions.
@MessageDriven turns a class into a container-managed JMS consumer. See how message-driven beans work, how to configure them and how transactions affect delivery.
Build an EJB message-driven bean with @MessageDriven and MessageListener, configure a JMS queue, and handle transactions and redelivery correctly.
What @Stateless does in EJB: pooled session beans, container-managed transactions, local and remote views, and how it compares with CDI beans.
Learn to build a Jakarta EE application with EJB: stateless, stateful, singleton and message-driven beans, injection into servlets, and deployment to a server.
A ResourceBundle stores per-language text for JSF and Jakarta Faces pages. Learn setup, Facelets usage, locale switching and validation messages.
Set up resource bundles, faces-config locale settings and a session-scoped locale bean to build a multilingual Jakarta Faces application.
The @FacesComponent annotation registers a Java class as a Faces UI component so Facelets pages can create and render it by name.
Use composite components for reusable markup and @FacesComponent with UIComponentBase for custom behaviour. Includes renderers and Jakarta Faces 4 packages.