spring-framework/framework-docs/modules/ROOT/pages/web/webmvc/mvc-config
Simon Baslé c92e043bbc Support multiple style of parsing/printing Durations
This commit introduces a notion of different styles for the formatting
of Duration.
The `@DurationFormat` annotation is added to ease selection of a style,
which are represented as DurationFormat.Style enum, as well as a
supported time unit represented as DurationFormat.Unit enum.

DurationFormatter has been retroffited to take such a Style,
optionally, at construction. The default is still the JDK style a.k.a.
ISO-8601.

This introduces the new SIMPLE style which uses a single number + a
short human-readable suffix. For instance "-3ms" or "2h".

This has the same semantics as the DurationStyle in Spring Boot and
is intended as a replacement for that feature, providing access to the
feature to projects that only depend on Spring Framework.

Finally, the `@Scheduled` annotation is improved by adding detection
of the style and parsing for the String versions of initial delay, fixed
delay and fixed rate.

See gh-22013
See gh-22474

Closes gh-30396
2024-07-23 11:56:48 +02:00
..
advanced-java.adoc Use code includes and tabs in MVC Config documentation 2024-03-29 17:58:01 +01:00
advanced-xml.adoc Use code includes and tabs in MVC Config documentation 2024-03-29 17:58:01 +01:00
content-negotiation.adoc Use code includes and tabs in MVC Config documentation 2024-03-29 17:58:01 +01:00
conversion.adoc Support multiple style of parsing/printing Durations 2024-07-23 11:56:48 +02:00
customize.adoc Use code includes and tabs in MVC Config documentation 2024-03-29 17:58:01 +01:00
default-servlet-handler.adoc Use code includes and tabs in MVC Config documentation 2024-03-29 17:58:01 +01:00
enable.adoc Polishing 2024-04-02 13:33:29 +02:00
interceptors.adoc Merge branch '6.1.x' 2024-05-13 11:41:22 +01:00
message-converters.adoc Use code includes and tabs in MVC Config documentation 2024-03-29 17:58:01 +01:00
path-matching.adoc Use code includes and tabs in MVC Config documentation 2024-03-29 17:58:01 +01:00
static-resources.adoc Use code includes and tabs in MVC Config documentation 2024-03-29 17:58:01 +01:00
validation.adoc Use code includes and tabs in MVC Config documentation 2024-03-29 17:58:01 +01:00
view-controller.adoc Use code includes and tabs in MVC Config documentation 2024-03-29 17:58:01 +01:00
view-resolvers.adoc Use code includes and tabs in MVC Config documentation 2024-03-29 17:58:01 +01:00