Skip to main content

A framework for Java application development

Combine IoC, AOP, configuration, Web MVC, and application startup as needed.

Compose what you need​

Start with hasor-core. Add configuration, Web MVC, and startup modules as needed.

  • Core

    An embeddable container with IoC, AOP, and lifecycle management.

    Core docs
  • Config

    Declare and wire objects with @Configuration and @Bean.

    Config docs
  • Web MVC

    Handle routing, parameter binding, and response rendering for web applications.

    Web MVC docs
  • Boot

    Start standalone Java or embedded web apps and build executable JARs.

    Boot docs

Development examples

After startup

  • Open /hello for JSON
  • Open /app/ for the static home page.
Web Launcher
package example;
import net.hasor.boot.Boot;
import net.hasor.boot.BootApplication;
import net.hasor.web.WebApiBinder;
import net.hasor.web.WebModule;

public class Application implements WebModule {
public static void main(String[] args) throws Exception {
try (BootApplication app = Boot.run(args, Application.class)) {
app.join();
}
}

// Serve static files from the classpath under /app/.
@Override
public void loadModule(WebApiBinder binder) {
binder.addClasspathResource("/app/**", "home");
}
}

Share your experience, report issues, and help improve Hasor.