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

📄 viewmessage.jsp

📁 一个小型的BBS系统
💻 JSP
字号:
<%@ page language="java" contentType="text/html; charset=gb2312"    pageEncoding="gb2312"%><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><%@page import="java.util.Vector"%>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>Insert title here</title></head><body>

<table width="921" height="600" border="2" align="center">
  <tr>
    <th height="51" colspan="2" scope="col">&nbsp;</th>
    <th width="298" rowspan="2" scope="col"><div align="center"><span class="STYLE2">软件工程交流论坛</span></div></th>
    <th colspan="2" scope="col">&nbsp;</th>
  </tr>



<%

System.out.println("开始绘制viewmessage.jsp");
String id; 
String currauthor;

id = (String)session.getAttribute("name");
currauthor = (String)session.getAttribute("author");

String master =(String)session.getAttribute("master");

System.out.println("当前master位为:"+master);

if(id!=null){
	%>
	   <tr>
	    <td width="150"><div align="center">用户ID:<%=id %></div></td>
	    <td width="154" height="17"> <div align="center">昵称: <%=currauthor %></div></td>
	    <td width="170"><div align="center"><a href="/bbs_design/ReqServlet?action=login">用户登陆</a> </div></td>
	    <td width="115"><div align="center"><a href="/bbs_design/ReqServlet?action=register">新用户注册</a></div></td>
	  </tr>
		 
	   <%	
	}
	else{
		id ="visitor";
		session.setAttribute("name","visitor");
		session.setAttribute("author","游客");
	%>
	  <tr>
	    <td width="150"><div align="center">用户ID:<%=id %></div></td>
	    <td width="154" height="17"> <div align="center">昵称: 游客</div></td>
	    <td width="170"><div align="center"><a href="/bbs_design/ReqServlet?action=login">用户登陆</a> </div></td>
	    <td width="115"><div align="center"><a href="/bbs_design/ReqServlet?action=register">新用户注册</a></div></td>
	  </tr>
	  <tr>
	    <td height="23">&nbsp;</td>
	    <td height="23">&nbsp;</td>
	    <td width="298" height="23">&nbsp;</td>
	    <td height="23">&nbsp;</td>
	    <td height="23">&nbsp;</td>
	  </tr>
	   <%} %> 
	   <%
	if(!id.equals("visitor")){%>
		
	     <tr>
	    <td height="23">&nbsp;</td>
	    <td height="23">&nbsp;</td>
	     <td width="298" height="23">
	     <jsp:useBean id="cm" scope="session" class="bean.check.CheckMessage" />
	     <a href="/bbs_design/ReqServlet?action=message&userid=<%=id %>">短消息</a>&nbsp未读<%=cm.CheckUnReadMessage(id) %>个</td>
	     <td height="23"><a href="/bbs_design/ReqServlet?action=usercontrolform&userid=<%=id %>">控制面板</a> </td>
	     <td height="23"><a href="/bbs_design/ReqServlet?action=quit">安全退出</a></td>
	     </tr>

	<%}
	%>
	    
	  <tr>
	    <td height="4" colspan="5"><div align="center">



<jsp:useBean id="dbsw" scope="session" class="bean.dbwrite.DBStateWrite" />

<a href="/bbs_design/ReqServlet?action=register">注册</a> 
<a href="/bbs_design/ReqServlet?action=login">登陆</a>
<%
if(!id.equals("visitor")){%>
	<a href="/bbs_design/ReqServlet?action=quit">安全退出</a>
	
<% 	
}
%>
<br><br>
<a href="/bbs_design/index.jsp">论坛主页</a> >> 
<a href="/bbs_design/ReqServlet?action=message&userid=<%=id %>" >短消息中心</a> >>
查看短消息
<br><br>
<br><%
Vector message = new Vector();
message = (Vector)request.getAttribute("message");
String ID = "";
String title = "";
String content = "";
String time = "";
String view = "";
String whosend = "";
String num = "";
ID = (String)message.elementAt(0);
title = (String)message.elementAt(1);
content = (String)message.elementAt(2);
time = (String)message.elementAt(3);
view = (String)message.elementAt(4);
whosend = (String)message.elementAt(5);
num = (String)message.elementAt(6);
%>
题目:<label><%=title %></label>&nbsp&nbsp时间:<label><%=time %></label>&nbsp&nbsp发送人:<label><%=whosend %></label><br>
内容:<label><%=content %></label>
<hr>
回复
<form action="/bbs_design/ReqMessage" method="get">
发给:<label><%=whosend %></label><br>
<%
if(title.indexOf("回复")==-1){%>
	标题:<input type="text" name="retitle" value="回复<%=title %>"><br>
<% 	
}
else{%>
	标题:<input type="text" name="retitle" value="<%=title %>"><br>
<% 	
}
%>

内容:<textarea name="recontent" rows="20" cols="80"></textarea><br>
<input type="hidden" name="action" value="sendmessage">

<input type="hidden" name="ID" value=<%=whosend %>>
<input type="hidden" name="whosend" value=<%=ID %>>
<input type="submit" value="发送" >
</form>


</div>   
</td>
  </tr>
</table>
</body></html>

⌨️ 快捷键说明

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