-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprofile.jsp
More file actions
58 lines (53 loc) · 1.84 KB
/
profile.jsp
File metadata and controls
58 lines (53 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<title>Профиль пользователя</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
}
.profile {
max-width: 600px;
margin: 0 auto;
}
.profile h2 {
color: #333;
}
.profile p {
margin: 10px 0;
}
</style>
</head>
<body>
<div class="profile">
<c:choose>
<c:when test="${empty sessionScope.user}">
<c:redirect url="login" />
</c:when>
<c:otherwise>
<h2>Профиль пользователя</h2>
<c:set var="user" value="${sessionScope.user}" />
<p><strong>Имя пользователя:</strong> ${user.username}</p>
<p><strong>Роль:</strong> ${user.role}</p>
<p><strong>Время входа:</strong>
<fmt:formatDate value="${user.loginTime}" pattern="dd.MM.yyyy HH:mm:ss" />
</p>
<c:if test="${user.role eq 'ADMIN'}">
<p><strong>Дополнительные права:</strong>
Администратор системы
</p>
</c:if>
<p>
<a href="userinfo">Информация о пользователе</a> |
<a href="logout">Выйти</a>
</p>
</c:otherwise>
</c:choose>
</div>
</body>
</html>