login.jspx 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
  2. xmlns:spring="http://www.springframework.org/tags"
  3. xmlns:c="http://java.sun.com/jsp/jstl/core"
  4. xmlns:form="http://www.springframework.org/tags/form" version="2.0">
  5. <jsp:directive.page language="java" contentType="text/html" />
  6. <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  7. <head>
  8. <title>Please Login</title>
  9. </head>
  10. <body>
  11. <c:url value="/login" var="loginUrl"/>
  12. <form name="f" action="${loginUrl}" method="post">
  13. <fieldset>
  14. <legend>Please Login</legend>
  15. <c:if test="${param.error != null}">
  16. <div class="alert alert-error">
  17. Failed to login.
  18. <c:if test="${SPRING_SECURITY_LAST_EXCEPTION != null}">
  19. Reason: <c:out value="${SPRING_SECURITY_LAST_EXCEPTION.message}" />
  20. </c:if>
  21. </div>
  22. </c:if>
  23. <c:if test="${param.logout != null}">
  24. <div class="alert alert-success">
  25. You have been logged out.
  26. </div>
  27. </c:if>
  28. <label for="j_username">Username</label>
  29. <input type="text" id="j_username" name="username" value="${username}"/>
  30. <label for="j_password">Password</label>
  31. <input type="password" id="j_password" name="password"/>
  32. <div class="form-actions">
  33. <button type="submit" class="btn">Log in</button>
  34. </div>
  35. </fieldset>
  36. </form>
  37. </body>
  38. </html>
  39. </jsp:root>