在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="确定" />
<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即可