📄 log.jsp
字号:
<%@ page contentType="text/html; charset=GBK" %>
<html>
<head>
<title>session参数示例</title>
</head>
<body>
<center>
<h3>登录参数</h3>
<form method="post" action="pa.jsp">
<p>用户名:<input type="TextField" name="product" value=""></p>
<p>密码:<input type="TextField" name="quantity" value=""></p>
<input type="submit" name="Submit" value=" 提交 ">
<input type="reset" value=" 重写 ">
<a href="sessionattribute2.jsp">显示session的参数</a>
</form>
<%
request.setCharacterEncoding("GBK");
String product1 = request.getParameter("product");
String quantity1 = request.getParameter("quantity");
if(product1!=null && quantity1!=null){
//设置session的参数
session.setAttribute("product", product1);
session.setAttribute("quantity", quantity1);
}
%>
</center>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -