Skip to main content

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 @Bean in hasor-config. See Java annotation configuration.
    • Add AnnotationInjector and ApiBinder.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.enabled to disable the embedded server while keeping Web dependencies in both Boot and ordinary Hasor applications. See headless mode.
  • 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 afterCompletion when the asynchronous request ends, with any error or timeout information.
    • Skip automatic rendering when an Action takes a ServletResponse parameter and returns null, preserving the application's response.
  • Improvements
    • Let RenderEngine declare a default response content type. The built-in JSON and text engines use application/json and text/plain respectively. Explicit settings take precedence.
    • When sources are 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.

Upgrade Notes​

  • Custom RenderEngine implementations must implement defaultContentType(). Return null if the engine has no default content type.
  • Custom ApiBinder implementations must implement bindAnnotationInjector(...). BasicBinder and ApiBinderWrap already implement it.
  • If your Boot application passes sources, set hasor.loadPackages explicitly to keep the previous scan range. Set it to an empty string to disable scanning. See the Boot launcher.