用html调用jsp文件时出现打开或保存该jsp页面是怎么回事?
怎么回事?应该怎么运行?regi.html<html><body><formaction="register.jsp"method="post"><p>姓名:<input...
怎么回事?应该怎么运行?
regi.html
<html>
<body>
<form action="register.jsp" method="post">
<p>姓名:<input type="text" size=20 name="userid"></p>
<p>密码:<input type="password" size=20 mame="userpwd"></p>
<p><input type="submit" value="提交"> </p>
</form>
</body>
</html>
register.jsp
<%@page contenttype="text/html;chatset=GBK"%>
<%@page import="java.util.*"%>
<%
String current_param="";
request.setCharacterEncoding("GBK");
Enumeration params=request.getParameterNames();
while(params.hasMoreElements()) {
current_param=(String)params.nextElement();
out.println("Name: "+current_param+"<br>");
out.println("Value: "+request.getParameter(current_param)+"<br>");
}
%> 展开
regi.html
<html>
<body>
<form action="register.jsp" method="post">
<p>姓名:<input type="text" size=20 name="userid"></p>
<p>密码:<input type="password" size=20 mame="userpwd"></p>
<p><input type="submit" value="提交"> </p>
</form>
</body>
</html>
register.jsp
<%@page contenttype="text/html;chatset=GBK"%>
<%@page import="java.util.*"%>
<%
String current_param="";
request.setCharacterEncoding("GBK");
Enumeration params=request.getParameterNames();
while(params.hasMoreElements()) {
current_param=(String)params.nextElement();
out.println("Name: "+current_param+"<br>");
out.println("Value: "+request.getParameter(current_param)+"<br>");
}
%> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询