Commit a227d78e authored by Arthur.Pautrel's avatar Arthur.Pautrel
Browse files

Task 5

parent 604f6991
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
...@@ -38,13 +37,13 @@ ...@@ -38,13 +37,13 @@
</head> </head>
<body> <body>
<div class="login-form"> <div class="login-form">
<form action="/examples/actions/confirmation.php" method="post"> <form action="task5.jsp" method="POST">
<h2 class="text-center">Log in</h2> <h2 class="text-center">Log in</h2>
<div class="form-group"> <div class="form-group">
<input type="text" class="form-control" placeholder="Username" required="required"> <input name="username" type="text" class="form-control" placeholder="Username" required="required">
</div> </div>
<div class="form-group"> <div class="form-group">
<input type="password" class="form-control" placeholder="Password" required="required"> <input name="password" type="password" class="form-control" placeholder="Password" required="required">
</div> </div>
<div class="form-group"> <div class="form-group">
<button type="submit" class="btn btn-primary btn-block">Log in</button> <button type="submit" class="btn btn-primary btn-block">Log in</button>
......
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
...@@ -7,6 +6,14 @@ ...@@ -7,6 +6,14 @@
<title>Task 5</title> <title>Task 5</title>
</head> </head>
<body> <body>
<h1>Successfully logged in !</h1> <%
String username = request.getParameter("username");
String password = request.getParameter("password");
if (username.equals("Arthur") && password.equals("123456")) {
out.println("Successfully logged in");
} else {
out.println("Username or password incorrect");
}
%>
</body> </body>
</html> </html>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment