1.0.0-SNAPSHOTDevelopment branch · Start exploring from sourceRead the getting-started guide →
Nnextrix.
DEVELOPER GUIDE

Routes and Actions

Express request handling and asynchronous results with Java methods.

master · 1.0.0-SNAPSHOT / Reviewed 2026-10-29

Declare a handler

HelloWorldAction uses Spring @Controller and a class-level @RouteMapping("hello"). Methods declare routes such as @RouteMapping("sayHello"). The example extends ControllerSupport and builds results with ok().withBody(...).

Synchronous and asynchronous results

Request handlers can return Result or CompletionStage. The repository includes sayHelloAsync as an asynchronous example. Choose asynchronous work, virtual threads, or other execution models according to the actual workload.

HelloWorldAction.java
import org.springframework.stereotype.Controller;
import io.nextrix.framework.Result;
import io.nextrix.framework.support.ControllerSupport;
import io.nextrix.framework.config.annotation.RouteMapping;

@Controller
@RouteMapping("hello")
public class HelloWorldAction extends ControllerSupport {
    @RouteMapping("sayHello")
    public Result sayHello(String content) {
        return ok().withBody("content=hi!");
    }
}
Source excerpt / Read with the complete example and environment configuration

Arguments and readability

Examples include Session, @RequestHeader arguments, and FrameStream. The excerpt below keeps one route and omits logging and other methods. Refer to the source for complete argument handling and configuration.

Source reference

This guide is based on the following source or module documentation. Repository access is required.

nextrix-j/nextrix-examples/nextrix-example-app/src/main/java/io/nextrix/example/demo/helloworld/action/HelloWorldAction.java
⌕
Type to search · Tab to select a result · Esc to close