<%@ page contentType="text/html;charset=UTF-8" language="java" %> Hello Action Guide
Guide

Hello action walkthrough

The hello demo is still the best first stop for explaining how Struts2 maps a request to an action and then routes to a JSP result.

Flow

Minimal action shape

public class HelloAction extends ActionSupport {
    private String name;
    private String message;

    public String execute() {
        if (name == null || name.trim().isEmpty()) {
            name = "World";
        }
        message = "Hello, " + name + "!";
        return SUCCESS;
    }
}