%@ page contentType="text/html;charset=UTF-8" language="java" %>
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.
/hello or /hello?name=Team.name property on HelloAction.execute() builds a view message and returns SUCCESS./hello.jsp.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;
}
}