-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsession.jsp
More file actions
32 lines (25 loc) · 1.06 KB
/
session.jsp
File metadata and controls
32 lines (25 loc) · 1.06 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
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<%
String userName=request.getParameter("username");
String password=request.getParameter("pwd");
if(userName==null)
userName="";
if(password==null)
password="";
if(!userName.equals(" ")&& !password.equals("")){
session.setAttribute("SessionUser", userName);
session.setAttribute("SessionPassword", password);
out.println("Welcome"+ userName+ "!");
out.println("<br/><a href=sessionresult.jsp> Next page with session true</a>");
out.println("<br/><a href=ShowFalseSession.jsp> Next page with session false.</a>");
}
else if(userName.equals(" ")){
out.println("<font color=red> <b> userName required.</b></font>");
out.println("<br/><a href=index.jsp> Go back!</a>");
}
else if(password.equals(" ")){
out.println("<font color=red> <b> Password required.</b></font>");
out.println("<br/><a href=index.jsp> Go back!</a>");
}
%>