📄 ok.jsp
字号:
<%@ page contentType="text/html; charset=GBK" %>
<jsp:useBean id="UtilDate" scope="request" class="operate_db.UtilDate" />
<html>
<head>
<title>登录用户信息显示</title>
<META http-equiv=Content-Type content="text/html; charset=GBK">
</head>
<%
String tname =(String)session.getAttribute("tname");//引用上个页面建立的会话获取字段信息
String uname =(String)session.getAttribute("uname");
String time = UtilDate.getDate("yyyy年MM月dd日");//定义时间变量,使用时间函数定义所需要的时间,并定义显示的格式来获取服务器的时间
String time2 = UtilDate.getDate("HH:mm:ss");
if(uname==null){
//如果没有获取上个页面会话中uname的值将执行下面的js,本功能主要防止用户没有登陆就先打开本页面
%>
<script language="javascript">
alert("请先登陆!"); //给予提示
window.location="index.jsp"; //转到另一个页面
</script>
<%
return;
}
%>
<body bgcolor="#0041de">
<table width="688" height="421" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="bottom" background="images/bg.gif"> <table width="438" height="228" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="top"> <strong> </strong>
<table width="441" height="88" border="1" cellpadding="0" cellspacing="0" bordercolor="#6699FF">
<tr>
<td width="114" align="center"><img src="images/err3.gif" width="116" height="147"></td>
<td width="320" align="center" valign="top"><table width="100%" height="126" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="48" align="center" valign="top"><br>
<font color="#FFFFFF"><strong>登录成功<br>
</strong><font size="2"><font color="#FFFFFF"><strong>
</strong></font></font></font></td>
</tr>
<tr>
<td height="62" align="center" valign="top"><div align="left">
<p><font color="#FFFFFF"><font size="2"> 您的姓名是:<%=tname%> </font></font></p>
<p><font color="#FFFFFF"><font size="2"> 您的用户名是:<%=uname%> <br>
<br>
<br>
</font></font></p>
</div></td>
</tr>
<tr>
<td height="16"><div align="center"><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">日期:<%=time%> <%=time2%></font></div></td>
</tr>
</table>
<div align="left"></div></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -