-
-
Notifications
You must be signed in to change notification settings - Fork 200
Expand file tree
/
Copy pathmodule-info.java
More file actions
54 lines (53 loc) · 1.74 KB
/
module-info.java
File metadata and controls
54 lines (53 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/**
* Provides declarative HTMX support for Jooby MVC routes.
*
* <p>This package contains annotations processed at compile-time by the Jooby HTMX APT generator.
* It allows developers to define partial HTML responses, out-of-band swaps, and dynamic client-side
* behaviors directly on their route methods without polluting business logic with header
* management.
*
* <h2>Core Concepts</h2>
*
* <ul>
* <li><b>Fragments:</b> Use {@link io.jooby.annotation.htmx.HxView} to define the HTML fragment
* to render.
* <li><b>Content Negotiation:</b> Define the {@code layout} attribute in {@code @HxView} to
* automatically handle direct browser navigation versus HTMX AJAX requests.
* <li><b>Behaviors:</b> Use annotations like {@link io.jooby.annotation.htmx.HxTrigger} or {@link
* io.jooby.annotation.htmx.HxTarget} to append {@code HX-} headers to the response.
* </ul>
*
* <h2>Example Usage</h2>
*
* <pre>{@code
* @Path("/users")
* public class UserController {
*
* @POST
* @HxView(
* value = "users/row.hbs",
* layout = "layouts/main.hbs",
* errorView = "users/form.hbs",
* errorTarget = "#user-form"
* )
* @HxTrigger(value = "userListUpdated", phase = Phase.AFTER_SETTLE)
* @HxOob("widgets/total-count")
* public User saveUser(UserDto dto) {
* // Business logic here. The APT generator handles view resolution,
* // validation errors, and HTMX headers.
* return repository.save(dto);
* }
* }
* }</pre>
*
* @since 4.5.0
* @author edgar
*/
module io.jooby.htmx {
exports io.jooby.annotation.htmx;
exports io.jooby.htmx;
requires io.jooby;
requires static org.jspecify;
requires typesafe.config;
requires org.slf4j;
}