Bonjour a tous et merci de prendre du temps pour mon post.
Pour information mon application est bien déployée et utilisable sur tomcat
quand je place les lignes de springsecurity en commentaire.
Voici mon problème depuis peu j'utilise Spring en test en auto-formation
les formulaires et autre Spring je parviens a les paramétrer et les utiliser,
et là je suis a une dernière étape pour commencer a faire un site de test et de mise en pratique de ces techniques Spring.
Je souhaite créer un simple module d'authentification web avec l'aide de spring security.
j'ai lu la documentation mais une chose m'échape et j'ai l'impression de mélanger des chose dans mon web.xml ainsi que mon context.servlet.xml
Je pense que j'ai des conflits dans la configuration web.xml mais je ne parviens pas a déterminer quoi..
Merci pour votre aide.
Voici mon web.xml
et voici mon context-servlet.xml
Code : 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75 <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd" > <web-app> <display-name>Archetype Created Web Application</display-name> <context-param> <param-name>contextConfigLocation</param-name> <param-value>/WEB-INF/webath-servlet.xml</param-value> </context-param> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <servlet> <servlet-name>webath</servlet-name> <servlet-class> org.springframework.web.servlet.DispatcherServlet </servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>webath</servlet-name> <url-pattern>*.htm</url-pattern> </servlet-mapping> <!-- Spring security Start <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> <context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/security-applicationContext.xml </param-value> </context-param> Spring security End --> <taglib> <taglib-uri>http://java.sun.com/jsp/jstl/fmt</taglib-uri> <taglib-location>/WEB-INF/tld/fmt.tld</taglib-location> </taglib> <taglib> <taglib-uri>http://java.sun.com/jsp/jstl/core</taglib-uri> <taglib-location>/WEB-INF/tld/c.tld</taglib-location> </taglib> <taglib> <taglib-uri>/spring</taglib-uri> <taglib-location>/WEB-INF/tld/spring.tld</taglib-location> </taglib> </web-app>
Merci de pourvoir m'aider
Code : 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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111 <?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:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd http://www.springframework.org/schema/security http://www.springframework.org"> <bean class="org.springframework.web.servlet.mvc.support.ControllerClassNameHandlerMapping" /> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/WEB-INF/jsp/"/> <property name="suffix" value=".jsp"/> </bean> <bean id="welcome" class="com.a8sys.web.WelcomeController"> <property name="supportedMethods" value="GET"/> <property name="cacheSeconds" value="60" /> </bean> <bean name="/welcome1.htm" class="com.a8sys.web.WelcomeController1"/> <bean name="/hello.htm" class="com.a8sys.web.HelloController"> <property name="supportedMethods" value="GET"/> <property name="cacheSeconds" value="60" /> </bean> <bean name="/listperson.htm" class="com.a8sys.web.ListPersonController"> <property name="supportedMethods" value="GET"/> <property name="cacheSeconds" value="60" /> </bean><!-- --><bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource"> <property name="basename" value="com.a8sys.beans.Customer" /> </bean> <bean class="com.a8sys.web.CustomerController"> <property name="formView" value="CustomerForm" /> <property name="successView" value="CustomerSuccess" /> <property name="validator"> <bean class="com.a8sys.services.CustomerValidator" /> </property> </bean> <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="interceptors"> <list> <ref local="localeChangeInterceptor"/> </list> </property> <property name="urlMap"> <map> <entry key="/login.htm"><ref bean="loginController"/></entry> <entry key="/welcome.htm"><ref bean="welcome"/></entry> <entry key="/user.htm"><ref bean="userController"/></entry> </map> </property> </bean> <bean id="userValidator" class="com.a8sys.userfullcontroller.UserValidator"/> <bean id="userController" class="com.a8sys.userfullcontroller.UserFormController"> <property name="sessionForm"><value>false</value></property> <property name="commandName"><value>user</value></property> <property name="commandClass"><value>com.a8sys.userfullcontroller.User</value></property> <property name="validator"><ref bean="userValidator"/></property> <property name="formView"><value>user</value></property> <property name="successView"><value>usersuccess</value></property> </bean> <!-- login without SpringSecurity --> <bean id="loginValidator" class="com.a8sys.fullcontroler.LoginValidator"/> <bean id="loginController" class="com.a8sys.fullcontroler.LoginFormController"> <property name="sessionForm"><value>false</value></property> <property name="commandName"><value>login</value></property> <property name="commandClass"><value>com.a8sys.fullcontroler.Login</value></property> <property name="validator"><ref bean="loginValidator"/></property> <property name="formView"><value>login</value></property> <property name="successView"><value>success</value></property> </bean> <bean id="localeChangeInterceptor" class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor"> <property name="paramName" value="hl"/> </bean> <bean id="localeResolver" class="org.springframework.web.servlet.i18n.SessionLocaleResolver"/><!-- <authentication-provider> <user-service> <user name="admin" password="admin" authorities="ROLE_ADMIN,ROLE_USER" /> <user name="guest" password="guest" authorities="ROLE_USER" /> </user-service> </authentication-provider> <http> <intercept-url patteran="/welcome.htm" access="ROLE_ADMIN"/> <intercept-url pattern="/**" access="ROLE_USER"/> </http> --></beans>
Partager