更新时间:2023-02-26 13:09:10
您可以在方法参数上使用 @PathVariable 注解.如果您需要验证变量的结构,@PathVariable 还允许使用正则表达式.
You can use @PathVariable annotation on a method argument. @PathVariable also allows regex if you need to validate the structure of the varible.
http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/mvc.html#mvc-ann-requestmapping
http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/web/bind/annotation/PathVariable.html
对于正则表达式
http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/web/bind/annotation/RequestMapping.html
html5输入类型url验证中的模式
Spring Security将URL参数传递给身份验证提供程序
在 Spring Security UsernamePasswordAuthenticationFilter JWT 身份验证中设置自定义登录 url
使用 Spring Security 进行预身份验证 ->基于 URL 参数