Skip to content

Instantly share code, notes, and snippets.

@ajinzrathod
Created June 8, 2021 18:20
Show Gist options
  • Save ajinzrathod/25c7c3088d1f5289c6fb663ff01150e8 to your computer and use it in GitHub Desktop.
Save ajinzrathod/25c7c3088d1f5289c6fb663ff01150e8 to your computer and use it in GitHub Desktop.
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<style>
.inp-field {
display: block;
padding: 5px;
margin: 5px;
}
</style>
</head>
<body>
<% if(session.getAttribute("can_login")!=null && Boolean.TRUE.equals(session.getAttribute("can_login"))) { %>
<p>Login status: ${can_login}</p>
<p>Signed in Successfully.</p>
<p> <a href="logout">Logout</a></p>
<% } else { %>
<% if(session.getAttribute("can_login")!=null && Boolean.FALSE.equals(session.getAttribute("can_login"))) {%>
<p>Incorrect Credentials</p>
<% } %>
<div>
<form action="login" method="post">
Username: <input type="text" name="username" class="inp-field">
Password: <input type="password" name="password" class="inp-field">
<input type="submit" class="inp-field" value="Login">
</form>
</div>
<% } %>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment