為什么輸出頁(yè)面顯示的都為null ??????
<%@ page language="java" contentType="text/html; charset=GB18030" pageEncoding="utf-8"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>處理頁(yè)</title>
</head>
<body>
<%
request.setAttribute("user","zhangfei");//存儲(chǔ)自定義數(shù)據(jù)
request.setAttribute("id","2");//存儲(chǔ)自定義數(shù)據(jù)
request.setAttribute("pwd","888888888");//存儲(chǔ)自定義數(shù)據(jù)
%>
id參數(shù)的值為:<%=request.getParameter("id")%><br>
user參數(shù)的值為:<%=request.getParameter("user")%><br>
pwd參數(shù)的值為:<%=request.getParameter("pwd")%>
</body>
</html>
2018-08-30
知道了,多謝哈
2018-08-30
應(yīng)該是request.getAttribute()方法而不是getParameter()方法