• jsp留言session


    简单的留言板显示

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>留言板</title>
    </head>
    <body>
    <form action="session0625.jsp" method="post" id="form1" name="form1">
    <div align="center">
    <table width="50%" border="0">
    <tr >
    <td width="10%">您的联系邮箱:</td>
    <td width="40%"><input type="text" name="email"/></td>
    </tr>
    </table>
    <table width="50%" border="0" height="40%">
    <tr><td>留言内容:</td></tr>
    <tr><td><input type="text" style=" 50%;height: 100%" name="liuyan"/></td></tr>
    <tr><td><input type="submit" value="提交"/></td></tr>
    
    </table>
    
    </div>
    
    </form>
    
    
    </body>
    </html>
    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>留言板session</title>
    </head>
    <body>
    <%
    String email=new String(request.getParameter("email").getBytes("ISO-8859-1"),"UTF-8");
    session.setAttribute("email",email);
    String liuyan=new String(request.getParameter("liuyan").getBytes("ISO-8859-1"),"UTF-8");
    session.setAttribute("liuyan",liuyan);
    %>
    <form action="result0625.jsp" method="post">
    <table>
    <tr><td>确定显示留言内容?</td></tr>
    <tr>
    <td><input type="submit" value="确定"/></td>
    <td><input type="reset" value="取消"/></td>
    </tr>
    
    </table>
    
    
    </form>
    <%-- 
    您的邮箱地址是:
    <%=email %>
    <br>
    您的留言内容是:
    <%=liuyan %>
    --%>
    
    
    
    </body>
    </html>
    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    </head>
    <body>
    <%
    String email=(String)session.getAttribute("email");
    String liuyan=(String)session.getAttribute("liuyan");
    %>
    
    
    
    您的邮箱地址是:
    <%=email %>
    <br>
    您的留言内容是:
    <%=liuyan %>
    
    
    </body>
    </html>

    运行结果:

  • 相关阅读:
    abcde =(ab+cd)的平方
    求水仙花数
    VS2019 开发 MFC ACtivex (OCX)控件
    简单体验pdfjs,并且隐藏下载、打印等按钮
    体验win10的linux子系统
    nodejs 连接 mysql 查询事务处理
    Linux系統日常運維管理
    hexo豆瓣卡片安裝遇到的坑
    ZooKeeper 是什么与概述,典型用例
    K8S_Kubernetes
  • 原文地址:https://www.cnblogs.com/miss123/p/5619122.html
Copyright © 2020-2023  润新知