0
我的控制器在字符串末尾附加了一个问号。它适用于各种类型的字符串。弹簧控制器:将Url作为参数传递404错误
https://www.mywebsite.com/attachQuestionmark/33 returns 33?
https://www.mywebsite.com/attachQuestionmark/hello returns hello?
但是它返回未找到错误对于网址,例如HTTPS :: //www.test.com。
https://www.mywebsite.com/attachQuestionmark/https:://www.test.com返回404错误。
有什么办法可以将完整的url传递给spring mvc控制器吗?
@RequestMapping(
value = MyUrlBuilder.API_CREATIVE_CREATE + "/attachQuestionmark/{string}",
method = RequestMethod.GET,
produces = MediaType.ALL_VALUE)
@ResponseBody
@PMET
public static String attachQustionmark(@PathVariable("url") String value)
{
return value + "?";
}
为什么呢?我只是好奇这是什么用例呢? –