获取Thymeleaf中的URL部分
我需要获取当前URL的某些部分。 我有如下URI地址:获取Thymeleaf中的URL部分,url,uri,thymeleaf,Url,Uri,Thymeleaf,我需要获取当前URL的某些部分。 我有如下URI地址: / /about /users/john /users/doe 我正在搜索一种从Thymeleaf获取字符串/users的方法 此${#httpServletRequest.requestURI}返回整个URI 在html页面中 <a th:href="@{'/about'}">About</a> @RequestMapping(value="/about",method=RequestMethod.GET)
/
/about
/users/john
/users/doe
我正在搜索一种从Thymeleaf获取字符串/users
的方法
此${#httpServletRequest.requestURI}
返回整个URI
在html页面中
<a th:href="@{'/about'}">About</a>
@RequestMapping(value="/about",method=RequestMethod.GET)
public String about(ModelMap model) {
}