Advertisement
Guest User

Untitled

a guest
May 13th, 2016
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.55 KB | None | 0 0
  1. <security:http auto-config="true">
  2. <security:intercept-url pattern="/login"
  3. access="permitAll" />
  4. <security:intercept-url pattern="/loginFailed"
  5. access="permitAll" />
  6. <security:intercept-url pattern="/**"
  7. access="hasRole('ROLE_USER')" />
  8.  
  9. <security:form-login login-page="/login"
  10. default-target-url="/home"
  11. always-use-default-target="true"
  12. authentication-failure-url="/loginFailed"
  13. login-processing-url="/j_spring_security_check"
  14. username-parameter="username"
  15. password-parameter="password"/>
  16.  
  17. <security:csrf disabled="true" />
  18. </security:http>
  19.  
  20. <security:authentication-manager>
  21. <security:authentication-provider>
  22. <security:user-service>
  23. <security:user name="root" password="password" authorities="ROLE_USER" />
  24. </security:authentication-provider>
  25. </security:authentication-manager>
  26.  
  27. <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
  28. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
  29. <%--<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>--%>
  30. <html>
  31. <head>
  32. <title>Login</title>
  33. <style type="text/css">
  34. .errorblock{
  35. color:#ff0000;
  36. background-color:#ffEEEE;
  37. border:3px solid #ff0000;
  38. padding:8px;
  39. margin:16px;
  40. }
  41.  
  42. </style>
  43. </head>
  44.  
  45. <body onload='document.f.j_username.focus();'>
  46. <h1>Login Page</h1>
  47. <c:if test="${not empty error}">
  48. <div class="errorblock">
  49. Your login was unsuccessful.<br/>
  50. Caused: ${sessionScope["SPRING_SECURITY_LAST_EXCEPTION"].message}
  51. </div>
  52. </c:if>
  53.  
  54. <form action="j_spring_security_check" name="f" method="POST">
  55. <table>
  56. <tr>
  57. <td>User:</td>
  58. <td><input type="text" name="j_username" value=""></td>
  59. </tr>
  60. <tr>
  61. <td>Password:</td>
  62. <td><input type="password" name="j_password"></td>
  63. </tr>
  64. <tr>
  65. <td colspan="2"><input type="submit" name="Submit" value="Submit"></td>
  66. </tr>
  67. <tr>
  68. <td colspan="2"><input type="reset" name="Reset" value="Reset"></td>
  69. </tr>
  70. </table>
  71. </form>
  72. </body>
  73. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement