Routing and parameters
Mateu binds URL parameters directly to ViewModel fields. There are no controllers, no manual parsing, and no mapping layer.
The URL is just another input to your UI state.
Path parameters
Section titled “Path parameters”Define placeholders in the route using :name syntax. Mateu maps them to fields with matching names.
@Route("/products/:id")public class ProductForm {
String id; // receives the value from the URL
}Navigating to /products/abc-123 sets id = "abc-123" before any action runs.
Query parameters
Section titled “Query parameters”Fields not covered by path parameters are populated from the query string automatically.
@Route("/products/:id")public class ProductForm {
String id; // from path int version; // from query string
}Navigating to /products/abc-123?version=2 sets:
id = "abc-123"version = 2
Mateu handles type conversion. A missing parameter uses the field’s default Java value.
Full example
Section titled “Full example”@Route("/products/:id")public class ProductForm {
String id; int version;
@NotBlank String name;
@Stereotype(FieldStereotype.radio) Status status;
@ReadOnly String audit;
@Button void inspect() { audit = "id=" + id + ", version=" + version + ", name=" + name; }
}URL:
http://localhost:8080/products/abc-123?version=2Result before the user acts:
id = "abc-123"version = 2nameandstatusare populated from whatever the browser sent as form state
What this enables
Section titled “What this enables”Traditional architectures require:
- Controller receives request
- Controller parses parameters
- Controller maps to a DTO
- DTO is passed to the UI layer
With Mateu:
- URL maps directly to the ViewModel
No intermediate layer. No boilerplate.
- Field names must match parameter names exactly (case-sensitive)
- Type conversion is automatic for primitives and common types (
String,int,long,boolean,LocalDate, etc.) - Missing parameters leave fields at their Java default value