我面临一个奇怪的问题。这是我的 REST API 映射
@RequestMapping(
value = { "/{email}" },
method = RequestMethod.GET,
params = "time")
public void getEmail(
@PathVariable("email") final String sender,
@RequestParam(value = "time", required = true) final long time)
当我这样调用 API
/someone@someone.com?time=10
我观察到sender
containssomeone@someone
而不是someone@someone.com
.
当我这样给它
@RequestMapping(
value = { "/{email:.+}" },
method = RequestMethod.GET,
params = "time")
public void getEmail(
@PathVariable("email") final String sender,
@RequestParam(value = "time", required = true) final long time)
我收到 406 错误。
我也试过这个。
<bean
class="org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping">
<property name="useSuffixPatternMatch" value="false" />
</bean>
仍然没有帮助。我究竟做错了什么?