Java 为什么我需要输入Spring MVC的*值?

Java 为什么我需要输入Spring MVC的*值?,java,spring,spring-mvc,Java,Spring,Spring Mvc,抱歉,如果这是一个愚蠢的问题:在使用之前,SpringMVC工作没有问题(没有*)。Idk为什么我需要*。代码工作正常,但如果getPlanilha具有相同的RequestMethod和Consumes将执行create方法?由*引起,因为两者的值相同(/planilha/anything) 我想我不明白这里的问题,您以前的映射是到/planilha,而您将其更改为/planilha/**?您应该保持这种方式,没有必要使用通配符there不适用于“/planilha”(我不知道为什么),我需要更

抱歉,如果这是一个愚蠢的问题:在使用之前,SpringMVC工作没有问题(没有*)。Idk为什么我需要*。代码工作正常,但如果
getPlanilha
具有相同的
RequestMethod
Consumes
将执行
create
方法?由*引起,因为两者的值相同(
/planilha/anything


我想我不明白这里的问题,您以前的映射是到/planilha,而您将其更改为/planilha/**?您应该保持这种方式,没有必要使用通配符there不适用于“/planilha”(我不知道为什么),我需要更改“/planilha/*”servlet映射在web.xml中的外观?
@RequestMapping(value = "/planilha/*", method = RequestMethod.POST, consumes = "application/json")
public String create(HttpServletRequest request, @RequestBody String jsonStr) {

}

@RequestMapping(value = "/planilha/{id}", method = RequestMethod.GET)
public String getPlanilha(@PathVariable("id") String id) {

}