07-信息管理系统--查看个人信息

本文档展示了如何在Web应用中创建一个名为userInfo.jsp的JSP页面,用于显示用户的个人信息,如ID、用户名、密码、性别和年龄等。页面中还包含了JavaScript代码来处理交互事件,并在left.jsp中添加了链接以便访问此页面。用户信息从session中获取,页面设计包括样式和JavaScript功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在WebRoot中新建文件夹user,在user文件夹新建JSP文件,userInfo.jsp

<%@ page language="java" import="java.util.*,com.lzy.pojo.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.js"></script>

<script type="text/javascript">
$(document).ready(function(){
  $(".click").click(function(){
  $(".tip").fadeIn(200);
  });
  
  $(".tiptop a").click(function(){
  $(".tip").fadeOut(200);
});

  $(".sure").click(function(){
  $(".tip").fadeOut(100);
});

  $(".cancel").click(function(){
  $(".tip").fadeOut(100);
});

});
</script>


</head>


<body>

	<div class="place">
    <span>位置:</span>
    <ul class="placeul">
    <li><a href="main/main.jsp">首页</a></li>
    <li><a href="main/main.jsp">个人信息</a></li>
    <li><a href="user/userInfo.jsp">查看个人信息</a></li>
    </ul>
    </div>
    
    <div class="rightinfo">
    <table class="tablelist">
    	<thead>
    	<tr>
        <th>用户ID<i class="sort"><img src="images/px.gif" /></i></th>
        <th>用户名</th>
        <th>密码</th>
        <th>性别</th>
        <th>年龄</th>
        <th>出生日期</th>
        
        </tr>
        </thead>
        <tbody>
        <tr>
       
        <td><%=((User)session.getAttribute("user")).getUid() %></td>
        <td><%=((User)session.getAttribute("user")).getUname() %></td>
        <td><%=((User)session.getAttribute("user")).getPwd() %></td>
        <% String age=((User)session.getAttribute("user")).getSex();
        if("1".equals(age)){
         %>
        <td></td>
        <%}else{ %>
         <td></td>
         <%} %>
        <td><%=((User)session.getAttribute("user")).getAge() %></td>
        <td><%=((User)session.getAttribute("user")).getBirth() %></td>     
        </tr>     
        </tbody>
    </table>   
    <div class="tip">
    	<div class="tiptop"><span>提示信息</span><a></a></div>
        
      <div class="tipinfo">
        <span><img src="images/ticon.png" /></span>
        <div class="tipright">
        <p>是否确认对信息的修改 ?</p>
        <cite>如果是请点击确定按钮 ,否则请点取消。</cite>
        </div>
        </div>
        
        <div class="tipbtn">
        <input name="" type="button"  class="sure" value="确定" />&nbsp;
        <input name="" type="button"  class="cancel" value="取消" />
        </div>
    </div>
    </div>
    <script type="text/javascript">
	$('.tablelist tbody tr:odd').addClass('odd');
	</script>

</body>

</html>
   

同时在left.jsp中添加链接

<ul class="menuson">
        
        <li><cite></cite><a href="user/userInfo.jsp" target="rightFrame">查看个人信息</a><i></i></li>
        <li><cite></cite><a href="user/changePwd.jsp" target="rightFrame">修改密码</a><i></i></li>
          </ul>  
        </dd>
       

在查看个人信息中链接写user/userInfo.jsp即可
在这里插入图片描述

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值