春天我有网址: -
echo "<script>";
echo "window.onload = function () {";
echo "var pixelArray = [];";
while ($arrayCounter <= $size)
{
echo "var name$arrayCounter = 'can' + $arrayCounter;";
echo "pixelArray.push(name$arrayCounter);";
$arrayCounter = $arrayCounter + 1;
}
while ($scriptCounter <= $size)
{
echo "var c = document.getElementById(\"can$scriptCounter\");";
echo "picoco$scriptCounter = c.style.backgroundColor = \"#000000\";";
$scriptCounter = $scriptCounter + 1;
}
echo "document.getElementById(\"arrayLoc\").innerHTML = pixelArray[0];";
echo "}";
echo "</script>";
?>
<p id="arrayLoc"></p>
我想获取“键”值
所以,我做了: -
http://localhost:8080/SpringMvc/viewdetail/id?key=1
但是,使用这段代码我没有任何价值。为什么?
答案 0 :(得分:1)
使用本地计算机中的相同代码,可以成功检索密钥的值。您能否分享您正在使用的web.xml,完整控制器类和弹簧版?
答案 1 :(得分:0)
试试这个,只做一点修改:
@RequestMapping(value = "/viewdetail/id",method=RequestMethod.GET)
public @ResponseBody String viewDetail11(Map<String, Object> map,
HttpServletRequest request, @RequestParam("key") int key) throws IOException {
detailservice.detail(key);
return "viewdetail";
}
注意:如果这不起作用,请确认以下内容: