Js中,这样把值传到后台,serverName能拿到
```![图片说明](https://img-ask.csdn.net/upload/201904/15/1555305857_326976.png)
$("body").delegate("#selectServer","click",function () {
var serverName =$("#soso").children("input").val();
window.location.href = SPRING_URL+"monitor/index?serverName="+serverName;
})
到后台
![图片说明](https://img-ask.csdn.net/upload/201904/15/1555305936_716617.png)
就成这样了 serverName为null
@RequestMapping("/index")
public String monitorIndex(@RequestParam(name = "serverName", required = false) String serverName, Model model, HttpServletRequest request) {
List list = serverStatusService.selectAllServerStatus(serverName);
model.addAttribute("serverList",JSONObject.toJSONString(list));
return "/monitor/monitor";
}
![图片说明](https://img-ask.csdn.net/upload/201904/15/1555306037_701316.jpg)
?后面的参数没了
上午还好好的 下午就不行了 不知道什么情况 其他地方相同的用法,就没问题
求大佬解惑
!!!!!!!![图片说明](https://img-ask.csdn.net/upload/201904/15/1555306153_961443.jpg)