控制器里路径变量的使用

1. 视图里如何写路径变量

form标签里面写路径

<form th:action="@{/adduser}"th:object="${user}"method="post">

以th:属性开头路径写在以@开头的花括号里面

a标签写路径

<p><a href="/adduser">添加新用户</a>

直接以/开头写路径即可

2.控制器里如何写路径变量 

return "redirect:/allUser"; 

以redirect开头为跳转

return "update-user";

  直接写为传递数据

posted @ 2019-06-27 20:41  麦克斯-侯  阅读(252)  评论(0编辑  收藏  举报
百纵科技