v5.4.0 (2026-11-27)
<dependency>
<groupId>net.hasor</groupId>
<artifactId>hasor-web</artifactId>
<version>5.4.0</version>
</dependency>
Changes
- New Features
- Scan and register concrete classes annotated with
@Beaninhasor-config. See Java annotation configuration. - Add
AnnotationInjectorandApiBinder.bindAnnotationInjector(...)to inject fields marked with custom annotations before Bean initialization. See custom annotation injection. - Add
WebApiBinder.addClasspathResource(...)to map directories on the application classpath to static resource URLs. - Add
hasor.boot.web.enabledto disable the embedded server while keeping Web dependencies in both Boot and ordinary Hasor applications. See headless mode.
- Scan and register concrete classes annotated with
- Bug Fixes
- Load configuration in the correct order so that applications can override framework defaults through
META-INF/hasor.schemas. - Restrict package scanning to the configured packages and their subpackages.
- Run matching application filters before continuing the Servlet filter chain when neither an Action nor a static resource matches.
- Fix result rendering and error dispatch for framework-managed asynchronous calls, avoiding repeated Action execution and preserving the request context path on worker threads.
- Let applications that start Servlet asynchronous processing own the response. Run MVC interceptor
afterCompletionwhen the asynchronous request ends, with any error or timeout information. - Skip automatic rendering when an Action takes a
ServletResponseparameter and returnsnull, preserving the application's response.
- Load configuration in the correct order so that applications can override framework defaults through
- Improvements
- Let
RenderEnginedeclare a default response content type. The built-in JSON and text engines useapplication/jsonandtext/plainrespectively. Explicit settings take precedence. - When
sourcesare provided, Boot scans their packages and subpackages by default. Explicit scan configuration takes precedence. - Upgrade Cobble to
5.0.5. - Migrate project tests to JUnit Jupiter and generate coverage reports with JaCoCo.
- Update the Hasor homepage, site navigation, and Boot examples.
- Let
Upgrade Notes
- Custom
RenderEngineimplementations must implementdefaultContentType(). Returnnullif the engine has no default content type. - Custom
ApiBinderimplementations must implementbindAnnotationInjector(...).BasicBinderandApiBinderWrapalready implement it. - If your Boot application passes
sources, sethasor.loadPackagesexplicitly to keep the previous scan range. Set it to an empty string to disable scanning. See the Boot launcher.