-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwelcome.jsp
More file actions
41 lines (40 loc) · 1.07 KB
/
welcome.jsp
File metadata and controls
41 lines (40 loc) · 1.07 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
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="javax.servlet.http.HttpSession" %>
<!DOCTYPE html>
<html>
<head>
<title>Welcome</title>
<style>
body {
font-family: Arial, sans-serif;
text-align: center;
margin-top: 50px;
}
</style>
</head>
<body>
<h1>Welcome to Pollify!</h1>
<%
// Get the user email from the session
HttpSession session = request.getSession(false);
if (session != null) {
String userEmail = (String) session.getAttribute("userEmail");
if (userEmail != null) {
%>
<p>Hello, <%= userEmail %>!</p>
<p>You are successfully logged in.</p>
<a href="logout.jsp">Logout</a>
<%
} else {
%>
<p>You are not logged in. Please <a href="login.jsp">login</a>.</p>
<%
}
} else {
%>
<p>You are not logged in. Please <a href="login.jsp">login</a>.</p>
<%
}
%>
</body>
</html>