From the course: HTMX with Thymeleaf in Spring Boot

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Response header annotations

Response header annotations

- [Instructor] With 04-09_begin/records-management loaded in IntelliJ, let's take a look at the HTMX spring-boot header response annotations that can be applied directly to a controller in our code base. Go ahead and run the mvn spring-boot:run command in the terminal. The HTMX Spring Boot Library offers some convenience annotations that perform similar functionality in utilizing the httpServletResponse or the HtmxResponse object where we set the HTMX headers dynamically. These annotations include the following as you can see here. Of these, we're going to take a deeper dive into a selection, which include HxPushUrl, HxRedirect, HxRefresh, and HxReplaceUrl. Let's also take a brief look at the GitHub repository for the HTMX Spring Boot Library annotations. We can click into each of these annotations to access the Java doc for more details. And the Java doc as well has links to connect to the HTMX.org site for more detailed documentation on what each response header does. Let's start…

Contents