zoukankan      html  css  js  c++  java
  • 4-1:编写一个简单的留言簿,写入留言提交后显示留言内容。

    login.jsp

    <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <base href="<%=basePath%>">
        
        <title>My JSP 'login.jsp' starting page</title>
        
        <meta http-equiv="pragma" content="no-cache">
        <meta http-equiv="cache-control" content="no-cache">
        <meta http-equiv="expires" content="0">    
        <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
        <meta http-equiv="description" content="This is my page">
        <!--
        <link rel="stylesheet" type="text/css" href="styles.css">
        -->
    
      </head>
      
      <body>
       <form id="form1" name="form1" meghod="post" action="login_deal.jsp">
        留言簿:<br>
        <textarea name="re" id="re" cols="45" rows="5"></textarea><br>
        <input type="submit" name="submit" value="提交" />
         
        </form> 
         
      </body>
    <ml>

    login_deal.jsp

     
    <%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
    <%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
    %>
    
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
      <head>
        <base href="<%=basePath%>">
        
        <title>My JSP 'login_deal.jsp' starting page</title>
        
        <meta http-equiv="pragma" content="no-cache">
        <meta http-equiv="cache-control" content="no-cache">
        <meta http-equiv="expires" content="0">    
        <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
        <meta http-equiv="description" content="This is my page">
        <!--
        <link rel="stylesheet" type="text/css" href="styles.css">
        -->
    
      </head>
      
      <body>
      <%
       String re=request.getParameter("re");
       out.println("您的留言为:"+re);
       %>
      </body>
    <ml>
     
  • 相关阅读:
    javascript数组对象
    jquery、javascript实现(get、post两种方式)跨域解决方法
    js检查字符串的包含关系
    element——message消息提示
    js把mysql传过来的时间格式化为:0000-00-00 00:00:00
    beego orm操蛋问题:操作都需要主键
    element——message-box
    VUE.js全局变量的定义
    element el-upload组件获取文件名
    go遍历某个文件夹
  • 原文地址:https://www.cnblogs.com/cancangood/p/4451488.html
Copyright © 2011-2022 走看看