Bonjour,
Je tente désespérément de mettre en place un projet J2EE avec le framework Spring Security 2.0.4 . mais toujours le même resultat :
Voilà ce que je fais :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6 Etat HTTP 404 - type Rapport d'état message description La ressource demandée () n'est pas disponible. Apache Tomcat/6.0.35
WebContent\index.jsp:
\WEB-INF\web.xml :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head> <body> <h1>Ceci est une page sécurisée</h1> </body> </html>
Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 <?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>SpringSecurity</display-name> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> <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.web.context.ContextLoaderListener</listener-class> </listener> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/app-security.xml</param-value> </context-param>
\WEB-INF\app-security.xml
Code xml : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23 <?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:p="http://www.springframework.org/schema/p" xmlns:security="http://www.springframework.org/schema/security" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.4.xsd"> <security:authentication-provider> <security:user-service> <security:user name="admin" password="admin" authorities="ROLE_ADMIN,ROLE_USER" /> <security:user name="guest" password="guest" authorities="ROLE_USER" /> </security:user-service> </security:authentication-provider> <security:http auto-config="true"> <security:intercept-url pattern="/" filters="none" /> <security:http-basic /> </security:http> </beans>
et j'ai ajouté les jars dans java build path :
commons-codec.jar
commons-logging.jar
log4j-1.2.14.jar
spring.jar
spring-beans.jar
spring-context.jar
spring-jdbc.jar
spring-security-acl-2.0.4.jar
spring-security-core-2.0.4.jar
spring-security-core-tiger-2.0.4.jar
spring-security-taglibs-2.0.4.jar
spring-web.jar
Merci d'avance pour votre aide !
Partager