login.jsp 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  3. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
  4. <html>
  5. <head>
  6. <title>Login Page</title>
  7. <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-KK94CHFLLe+nY2dmCWGMq91rCGa5gtU4mk92HdvYe+M/SXH301p5ILy+dN9+nJOZ" crossorigin="anonymous">
  8. <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha3/dist/js/bootstrap.bundle.min.js" integrity="sha384-ENjdO4Dr2bkBIFxQpeoTz1HIcje39Wm4jDKdf19U8gI4ddQ3GYNS7NTKfAdVQSZe" crossorigin="anonymous"></script>
  9. </head>
  10. <body onload='document.loginForm.username.focus();'>
  11. <div class="container">
  12. <div class="row">
  13. <div class="col-md-offset-5 col-md-3">
  14. <c:if test="${not empty error}">
  15. <div class="error">${error}</div>
  16. </c:if>
  17. <c:if test="${not empty msg}">
  18. <div class="msg">${msg}</div>
  19. </c:if>
  20. <form class="form-signin" name='loginForm' action="<c:url value='/login' />" method='POST'>
  21. <input type="text" name='login' id="inputEmail" class="form-control" placeholder="Login" required autofocus/>
  22. <input type="password" name='password' id="inputPassword" class="form-control" placeholder="Password" required/>
  23. <div id="remember" class="checkbox">
  24. <label>
  25. <input type="checkbox" value="remember-me"> Remember me
  26. </label>
  27. </div>
  28. <button class="btn btn-lg btn-primary btn-block btn-signin" type="submit">Sign in</button>
  29. <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" />
  30. </form>
  31. </div>
  32. </div>
  33. </div>
  34. <!--
  35. <style>
  36. .error {
  37. padding: 15px;
  38. margin-bottom: 20px;
  39. border: 1px solid transparent;
  40. border-radius: 4px;
  41. color: #a94442;
  42. background-color: #f2dede;
  43. border-color: #ebccd1;
  44. }
  45. .msg {
  46. padding: 15px;
  47. margin-bottom: 20px;
  48. border: 1px solid transparent;
  49. border-radius: 4px;
  50. color: #31708f;
  51. background-color: #d9edf7;
  52. border-color: #bce8f1;
  53. }
  54. #login-box {
  55. width: 300px;
  56. padding: 20px;
  57. margin: 10px auto;
  58. background: #fff;
  59. -webkit-border-radius: 2px;
  60. -moz-border-radius: 2px;
  61. border: 1px solid #000;
  62. }
  63. </style>
  64. </head>
  65. <body onload='document.loginForm.username.focus();'>
  66. <h3>Spring Security Custom Login Page</h3>
  67. <div id="login-box">
  68. <h3>Login with Username and Password</h3>
  69. <c:if test="${not empty error}">
  70. <div class="error">${error}</div>
  71. </c:if>
  72. <c:if test="${not empty msg}">
  73. <div class="msg">${msg}</div>
  74. </c:if>
  75. <form name='loginForm' action="<c:url value='/login'/>" method='POST'>
  76. <table>
  77. <tr>
  78. <td>AppUser:</td>
  79. <td><input type='text' name='login' value=''></td>
  80. </tr>
  81. <tr>
  82. <td>Password:</td>
  83. <td><input type='password' name='password' /></td>
  84. </tr>
  85. <tr>
  86. <td colspan='2'><input name="submit" type="submit" value="submit" /></td>
  87. </tr>
  88. </table>
  89. <input type="hidden" name="${_csrf.parameterName}" value="${_csrf.token}" />
  90. </form>
  91. </div>
  92. -->
  93. </body>
  94. </html>