log.jsp

来自「本系统采用Servlet+Jsp+JavaBean+SQL2000 设计方式」· JSP 代码 · 共 30 行

JSP
30
字号
<%@ 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 + =
减小字号Ctrl + -
显示快捷键?