@Controller
public class HelloController {
@RequestMapping("/hello")
public String hello(Model model) {
model.addAttribute("message", "Hello, World!");
return "hello";
}
}
public class Application {
public static void main(String[] args) {
Application app = new Application();
app.run();
}
public void run() {
ApplicationContext context = new ApplicationContext();
context.scan("com.example");
context.start();
}
}