Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.38 KB | None | 0 0
  1. Error 404 : Project/j_spring_security_check is not available
  2.  
  3. <h:form id="loginForm" prependId="false" >
  4. <label for="exampleInputEmail1">Email address</label>
  5. <h:inputText class="form-control" id="j_username" required="true"/>
  6. <label for="exampleInputPassword1">Password</label>
  7. <h:inputSecret class="form-control" id="j_password" required="true"/>
  8. <h:commandButton type="submit" class="btn btn-primary btn-block" action="#{authentication.doLogin()}" value="Login" />
  9. </h:form>
  10.  
  11. public String doLogin() throws ServletException, IOException
  12. {
  13. ExternalContext context=FacesContext.getCurrentInstance().getExternalContext();
  14. RequestDispatcher dispatcher=((ServletRequest)context.getRequest()).getRequestDispatcher("j_spring_security_check");
  15. dispatcher.forward((ServletRequest)context.getRequest(),(ServletResponse)context.getResponse());
  16. FacesContext.getCurrentInstance().responseComplete();
  17. return null;
  18. }
  19.  
  20. <http auto-config="true">
  21. <intercept-url pattern="/j_spring_security_check" access="IS_AUTHENTICATED_ANONYMOUSLY"/>
  22. <intercept-url pattern="/login.xhtml*" access="IS_AUTHENTICATED_ANONYMOUSLY" />
  23. <intercept-url pattern="/Backoff/*" access="ROLE_USER"/>
  24. <form-login login-page="/login.xhtml" default-target-url="/Backoff/activities.xhtml"
  25. always-use-default-target="true"
  26. authentication-failure-url="/Front/error.xhtml" />
  27. </http>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement