Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
获取Thymeleaf中的URL部分_Url_Uri_Thymeleaf - Fatal编程技术网

获取Thymeleaf中的URL部分

获取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)

我需要获取当前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)
    public String about(ModelMap model) {
}