我有一個html:無法從HTML將參數傳遞給控制器
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<form name="AppE" method="post" action="http://10.18.9.10:8280/Ey/lin">
<input type="text" name="userIdd" id="userIdd"><br/>
<input type="text" name="passwordd" id="passwordd"><br/>
<input type="text" name="appSerialNon" id="appSerialNon"><br/>
<input type="submit" name="Submit">
</form>
</body>
</html>
/林去該控制器:
@RequestMapping(value = "/lin", method = RequestMethod.GET)
public String login(@RequestParam(required=false, value="userIdd")String userIdd, @RequestParam(required=false, value="passwordd")String passwordd,@RequestParam(required=false, value="appSerialNon")String appSerialNon) {
System.out.println(userIdd+" "+passwordd+" "+appSerialNon);
return "login/login"
}
訪問HTML和填充值後,並提交我正在重定向到期望的頁面,但我在控制檯上得到空值,即我不能夠發送參數從HTML到控制器類。