Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.04 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:context="http://www.springframework.org/schema/context"
  5. xmlns:util="http://www.springframework.org/schema/util"
  6. xmlns:security="http://www.springframework.org/schema/security"
  7. xmlns:task="http://www.springframework.org/schema/task"
  8. xsi:schemaLocation="
  9. http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.2.xsd
  10. http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  11. http://www.springframework.org/schema/task http://www.springframework.org/schema/task/spring-task-3.2.xsd
  12. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.2.xsd
  13. http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd">
  14.  
  15. <security:http>
  16. <security:intercept-url pattern="/faces/gestor" access="ROLE_USER" />
  17. <security:form-login login-page="/login.html" default-target-url="/faces/gestor/visualizaractualizarestabelecimento.xhtml" authentication-failure-url="/login.html?erro=true"/>
  18. <security:logout logout-success-url="/login.html" />
  19. </security:http>
  20.  
  21. <bean class="mz.co.mpteventos.springsecurity.controller.UserDetailServiceImpl" id="userDetailsService"></bean>
  22.  
  23. <security:authentication-manager>
  24. <security:authentication-provider user-service-ref="userDetailsService"></security:authentication-provider>
  25. </security:authentication-manager>
  26. </beans>
  27.  
  28. **Controlador**
  29.  
  30. <form class="login-container"
  31. action="/springsecurity/j_spring_security_check" method="POST">
  32. <p>
  33. <input placeholder="Username" id="j_username" name="j_username"
  34. type="text" class="validate" required="required"> <label
  35. for="first_name">Introduza o nome de usuario</label>
  36. </p>
  37. <p>
  38. <input id="j_password" name="j_password" class="validate"
  39. type="password" placeholder="Password" required="required">
  40. <label for="last_name">Introduza a senha</label>
  41. </p>
  42. <p>
  43. <input name="action" type="submit" value="Entrar" >
  44. </p>
  45. </form>
  46. </div>
  47.  
  48. <form class="login-container"
  49. action="/springsecurity/j_spring_security_check" method="POST">
  50. <p>
  51. <input placeholder="Username" id="j_username" name="j_username"
  52. type="text" class="validate" required="required"> <label
  53. for="first_name">Introduza o nome de usuario</label>
  54. </p>
  55. <p>
  56. <input id="j_password" name="j_password" class="validate"
  57. type="password" placeholder="Password" required="required">
  58. <label for="last_name">Introduza a senha</label>
  59. </p>
  60. <p>
  61. <input name="action" type="submit" value="Entrar" >
  62. </p>
  63. </form>
  64. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement