/**
* Thymeleaf url表达式
*/
@Controller
public class DemoController {
@RequestMapping("/{page}")
public String showInfo (@PathVariable String page, Integer id, String name) {
System.out.println("id=========" + id);
System.out.println("name=========" + name);
return page;
}
}
@SpringBootApplication
public class App {
public static void main(String[] args) {
SpringApplication.run(App.class, args);
}
}
index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Thymeleaf语法详解-URL表达