spring mvc 重定向,地址栏带了参数,不想带怎么办
1个回答
展开全部
用post啊,不要用get啊
@RequestMapping(value = "coop/searchInventoryById", method = RequestMethod.POST)
@ResponseBody
public InventoryInfo searchInventoryById(
@RequestParam(required = true) final String searchId) {
String[] ids = searchId.split(",");
InventoryInfo inventoryInfo = null;
if (ids.length < 1) {
inventoryInfo = inventoryInfoService.getInventoryInfoByPK(searchId);
} else {
inventoryInfo = inventoryInfoService.getInventoryInfoByPK(ids[0]);
}
// TODO:测试用
System.out.println("search-----" + inventoryInfo.toString());
return inventoryInfo;
}
@RequestMapping(value = "coop/searchInventoryById", method = RequestMethod.POST)
@ResponseBody
public InventoryInfo searchInventoryById(
@RequestParam(required = true) final String searchId) {
String[] ids = searchId.split(",");
InventoryInfo inventoryInfo = null;
if (ids.length < 1) {
inventoryInfo = inventoryInfoService.getInventoryInfoByPK(searchId);
} else {
inventoryInfo = inventoryInfoService.getInventoryInfoByPK(ids[0]);
}
// TODO:测试用
System.out.println("search-----" + inventoryInfo.toString());
return inventoryInfo;
}
Storm代理
2023-08-29 广告
2023-08-29 广告
StormProxies是全球大数据IP资源服务商,其住宅代理网络由真实的家庭住宅IP组成,可为企业或个人提供满足各种场景的代理产品。点击免费测试(注册即送1G流量)StormProxies有哪些优势?1、IP+端口提取形式,不限带宽,IP...
点击进入详情页
本回答由Storm代理提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询