Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 在表单中使用post方法时出错_Html_Jsp_Struts_Html Select_Idempotent - Fatal编程技术网

Html 在表单中使用post方法时出错

Html 在表单中使用post方法时出错,html,jsp,struts,html-select,idempotent,Html,Jsp,Struts,Html Select,Idempotent,当我在将表单传递到下一页时使用post方法时,我将得到null 重复这个问题 标题 函数callme() { 警报(“Hi”); 警报(document.getElementById(“prio”).value); } 1. 2. 在testjsp.jsp中,我试图对prio变量进行prin操作,但我无法对其进行prin操作,它的prin值为null。我只想在其他服务器端组件中访问变量prio,还想使用post方法 <html> <head> Tit

当我在将表单传递到下一页时使用post方法时,我将得到null 重复这个问题


标题
函数callme()
{        
警报(“Hi”);
警报(document.getElementById(“prio”).value);
}
1.
2.
在testjsp.jsp中,我试图对prio变量进行prin操作,但我无法对其进行prin操作,它的prin值为null。我只想在其他服务器端组件中访问变量prio,还想使用post方法

<html>
<head>
Title  
</head>
<body>
<%
String prio=request.getParameter("prio");
out.println("the value of prio is"+prio);
%>

</body>
</html>

标题
这和幂等性质有关吗?
我不明白为什么我不能访问testjsp页面中的变量prio。

您将请求编码为
多部分/表单数据
,通常用于上传文件。servlet容器不支持自动解码此数据,仅支持
application/x-www-form-urlencoded
数据(默认值)。要使用
多部分/表单数据
,您需要一个第三方MIME解析器,如

<html>
<head>
Title  
</head>
<body>
<%
String prio=request.getParameter("prio");
out.println("the value of prio is"+prio);
%>

</body>
</html>