1- Quando eu tento logar, simplemente nao funciona, ele é redirecionado para o meu index.xhtml, mas com assim " /j_spring_security_check/index.xhtml." e eu tenho o seguinte3 erro no meu log, ele ta redirecionando para o mesmo link que esta no meu welcome-file-list no web.xml
WARNING [http-apr-8080-exec-46] com.sun.faces.application.resource.ResourceHandlerImpl.logMissingResource JSF1064: Unable to find or serve resource, /j_spring_security_check/index.xhtml.
2- Nenhum dos meus filtros de acesso funcionam, todos estao com acesso livre
springsecurity.xml
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:security="http://www.springframework.org/schema/security"
xsi:schemaLocation="http://www.springframework.org/schema/security
http://www.springframework.org/schema/security/spring-security-3.2.xsd
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<!-- Referencia a pasta e o tipo de usuario que pode acessa-la -->
<security:http access-denied-page="/erros/403.xhtml" auto-config="true" use-expressions="true" >
<!-- Tem que estar autenticado para acessar a pasta -->
<security:intercept-url pattern="/admin/*"
access="isAuthenticated()" />
<security:intercept-url pattern="/cliente/*"
access="isAuthenticated()" />
<security:intercept-url pattern="/cliente/**"
access="hasRole('ROLE_CLIENTE')" />
<security:intercept-url pattern="/admin/**"
access="hasRole('ROLE_ADMIN')" />
<security:intercept-url pattern="/restrito/*"
access="denyAll" />
<security:intercept-url pattern="/loja/*"
access="permitAll" />
<security:form-login authentication-failure-url="/protegido/e-Login.xhtml?erro=true"
always-use-default-target="true"
login-page="/protegido/e-Login.xhtml"
username-parameter="email" password-parameter="senha" />
<security:logout invalidate-session="true" logout-success-url="/index.xhtml" />
</security:http>
<!-- users-by-username-query - Pega o usuário do banco e se pode autenticar
, authorities-by-username-query - Pega usuário e autorização -->
<security:authentication-manager>
<security:authentication-provider>
<security:jdbc-user-service
data-source-ref="dataSource"
users-by-username-query="select email, senha, autorizado from usuario where email=?"
authorities-by-username-query="select us.email, a.descricao from usuario us, autorizacao a where
a.id = us.autorizacao_id AND us.email = ?" />
</security:authentication-provider>
</security:authentication-manager>
</beans>
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
id="WebApp_ID" version="2.5">
<display-name>JavaServerFaces</display-name>
<!-- configura o tempo para timeout da sessao-->
<session-config>
<session-timeout>30</session-timeout>
</session-config>
<!-- Filtro Spring Security -->
<filter>
<filter-name>springSecurityFilterChain</filter-name>
<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
<filter-name>springSecurityFilterChain</filter-name>
<url-pattern>/*/</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<error-page>
<error-code>404</error-code>
<location>/erros/404.xhtml</location>
</error-page>
<error-page>
<error-code>403</error-code>
<location>/erros/403.xhtml</location>
</error-page>
<!-- Change to "Production" when you are ready to deploy -->
<context-param>
<param-name>javax.faces.PROJECT_STAGE</param-name>
<param-value>Development</param-value>
</context-param>
<!-- Welcome page -->
<welcome-file-list>
<welcome-file>index.xhtml</welcome-file>
</welcome-file-list>
<display-name>ofertacidade</display-name>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- Map these files with JSF -->
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>/faces/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.jsf</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.faces</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<!-- needed for ContextLoaderListener -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/springdatabase.xml,/WEB-INF/springsecurity.xml</param-value>
</context-param>
<!-- Bootstraps the root web application context before servlet initialization -->
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
</web-app>
login.xhtml
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:p="http://primefaces.org/ui">
<h:head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Login Administrador</title>
<!-- Bootstrap core CSS -->
<h:outputStylesheet library="resources" name="css/bootstrap.css" />
<!--external css-->
<h:outputStylesheet library="resources" name="font-awesome/css/font-awesome.css" />
<!-- Custom styles for this template -->
<h:outputStylesheet library="resources" name="css/style.css" />
<h:outputStylesheet library="resources" name="css/style-responsive.css" />
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</h:head>
<h:body>
<!-- **********************************************************************************************************************************************************
MAIN CONTENT
*********************************************************************************************************************************************************** -->
<div id="login-page">
<div class="container">
<form class="form-login" action="${request.contextPath}/j_spring_security_check/" method="post" id="loginAdm" >
<h2 class="form-login-heading">Logar</h2>
<h4 align="center"><p:outputLabel value="Usuário Inválido" rendered="#{param.erro}"/></h4>
<div class="login-wrap">
<p:inputText id="email" class="form-control" onfocus="true" placeholder="Usuário" />
<br></br>
<p:password id="senha" class="form-control" onfocus="true" placeholder="Senha" />
<br></br>
<h:commandButton class="btn btn-theme btn-block" value="ENTRAR"></h:commandButton>
<hr></hr>
<div class="login-social-link centered">
<label class="checkbox">
<!-- <h:link value="Esqueceu a Senha ?" outcome="recuperarSenha.xhtml"class="btn btn-theme btn-block"/>-->
</label>
</div>
</div>
</form>
</div>
</div>
<!-- js placed at the end of the document so the pages load faster -->
<h:outputScript library="resources" name="js/jquery.js" />
<h:outputScript library="resources" name="js/bootstrap.min.js" />
<!--BACKSTRETCH-->
<!-- You can use an image of whatever size. This script will stretch to fit in any screen size.-->
<h:outputScript library="resources" name="js/jquery.backstretch.min.js" />
<script>
$.backstretch("../resources/images/login-bgAdm.jpg", {speed: 500});
</script>
</h:body>
</html>
Alguem?