⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 post.jsp

📁 这是一个用JSP技术做的论坛短消息
💻 JSP
字号:
<%@ page language="java" import="java.util.*,java.sql.*,dao.*,entity.*,impl.*"
	pageEncoding="GBK"%>
<%
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>发送消息</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="style/style.css">
	<script type="text/javascript">
	function ch(){
		if(document.myform.rname.value==""||document.myform.rname.value==null){
			alert("接收者姓名不能为空");
			return false;
		}else if(document.myform.mynote.value==""||document.myform.mynote.value==null){
			alert("消息不能为空");
			return false;
		}else{
		document.myform.submit();
		}
	}
	</script>
  </head>
  <%
  	String name=request.getParameter("name");
  	String name1 = request.getParameter("name1");
   %>
  <body class="gray">
    <form action="doPost.jsp" method="post" name="myform">
			<center>
				<h4>
					当前用户
					<%=name1 %>
					<input type="hidden" name="hi" value="<%=name1%>" class="input">
					<a href="index.jsp">[登出]</a>&nbsp;&nbsp;
					<a href="listMsg.jsp">[我的短消息]</a>
				</h4>
			<h1>
				发短消息
			</h1>
			<table>
			<tr>
			<td>发送给</td>
			<td><input type="text" name="rname" value=<%=name %> class="input" /></td>
			</tr>
			<tr>
			<td >短消息</td>
			<td><textarea rows="5" cols="20" name="mynote"></textarea></td>
			</tr>
			<tr>
			<td colspan="2"><input type="button" value="发 送" onclick="ch()" class="btn"/></td>
			</tr>
			</table>
			</center>
		</form>

  </body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -