问题重现

1
@RequestMapping(value = "/email/exist/{email:.+}")

获取到的email丢失邮箱小数点之后的内容

mwernher6@columbia.edu只能获取到mwernher6@columbia

原因

see:https://carlzone.blog.csdn.net/article/details/71791673

Spring将最后url一个.视为Mapping中的通配符。将带有点的路径视为/email/exist/{email}.*

解决办法

  • 在最后添加:.+

    /email/exist/{email:.+}

  • 或使带有点的参数不作为最后一个参数

    /email/exist/{email}/{others}