-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindexEL.jsp
39 lines (30 loc) · 1.01 KB
/
indexEL.jsp
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
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>IndexEL</title>
</head>
<body>
<h3>Hello ${initParam.user}</h3>
I see you like to use <br><strong>${header["user-agent"]}</strong><br> to browse!
<br>${pageContext.request.contextPath}<br>
<h4>HeaderValues:</h4>
${headerValues}<br>
<h2>The application variables tell us:</h2>
<p>User: ${applicationScope.uid}</p>
<p>Password: ${applicationScope.pwd}</p>
<%
session.setAttribute("uid", "SessionScopeUser");
session.setAttribute("pwd", "SessionScopePassword");
int cookieLife = 3600 * 24 * 7;
Cookie uidCook = new Cookie("credentials_uid", "CookieUser");
uidCook.setMaxAge(cookieLife);
response.addCookie(uidCook);
Cookie pwdCook = new Cookie("credentials_pwd", "CookiePassword");
uidCook.setMaxAge(cookieLife);
response.addCookie(pwdCook);
%>
<br><br>
<jsp:include page="navbarEL.jsp"/>
</body>
</html>