Create login form and perform state management using Cookies, HttpSession and URL Rewriting.
<!-- HTML FILE -->
<html>
<head>
<title>Login</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
.b1 {
width: 370px;
height: 40px;
margin: 10px;
color: white;
background-color: #008CBA;
border: 0px solid grey;
cursor: pointer;
}
.side {
padding: 10px;
margin: 10px;
width: 370px;
}
h1 {
color: white;
}
.box {
margin-top: 200px;
}
</style>
</head>
<body bgcolor="#222222" align="center">
<div class="box">
<h1> Welcome to Login Portal</h1>
<form action="FirstServlet" method="post">
<input class="side" type="text" name="userName" placeholder="Username" /><br />
<input class="side" type="password" name="password" placeholder="Password" /><br />
<input class="b1" type="submit" value="Login" />
</form>
</div>
</body>
</html>