Bonjour,
Merci pour vos réponses.
Donc pour répondre à willoi:
Je n'ai pas de code html généré par les balises.
Et voici mon web.xml:
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 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
| <?xml version="1.0" encoding="UTF-8"?>
<web-app id="localhosto-privateweb" version="2.5"
xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>Localhosto Private Web</display-name>
<!-- filtre SessionInView -->
<filter>
<filter-name>sessionInView</filter-name>
<filter-class>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>sessionInView</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
</listener>
<filter>
<filter-name>Spring character encoding filter</filter-name>
<filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>utf-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>Spring character encoding filter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<jsp-config>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<page-encoding>UTF-8</page-encoding>
</jsp-property-group>
</jsp-config>
<session-config>
<session-timeout>15</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<!-- Stripes Filter -->
<filter>
<filter-name>StripesFilter</filter-name>
<filter-class>
net.sourceforge.stripes.controller.StripesFilter
</filter-class>
<init-param>
<param-name>ActionResolver.Packages</param-name>
<param-value>org.insia.localhosto.privateweb.action</param-value>
</init-param>
<init-param>
<param-name>Extension.Packages</param-name>
<param-value>org.insia.localhosto.privateweb.stripes.ext</param-value>
</init-param>
<init-param>
<param-name>ActionBeanContext.Class</param-name>
<param-value>org.insia.localhosto.privateweb.action.PrivateWebActionBeanContext</param-value>
</init-param>
<init-param>
<param-name>ExceptionHandler.Class</param-name>
<param-value>org.insia.localhosto.privateweb.action.PrivateWebExceptionHandler</param-value>
</init-param>
<!-- Spring interceptor -->
<init-param>
<param-name>Interceptor.Classes</param-name>
<param-value>
net.sourceforge.stripes.integration.spring.SpringInterceptor,
net.sourceforge.stripes.controller.BeforeAfterMethodInterceptor
</param-value>
</init-param>
</filter>
<servlet>
<servlet-name>DispatcherServlet</servlet-name>
<servlet-class>
net.sourceforge.stripes.controller.DispatcherServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<filter-mapping>
<filter-name>StripesFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>StripesFilter</filter-name>
<servlet-name>DispatcherServlet</servlet-name>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
</filter-mapping>
<!-- Dynamic Mapping Filter -->
<filter>
<filter-name>DynamicMappingFilter</filter-name>
<filter-class>
net.sourceforge.stripes.controller.DynamicMappingFilter
</filter-class>
</filter>
<filter-mapping>
<filter-name>DynamicMappingFilter</filter-name>
<url-pattern>/*</url-pattern>
<dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
</filter-mapping>
<!-- 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>
<!-- Spring -->
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext*.xml</param-value>
</context-param>
</web-app> |
Ensuite pour répondre à douglasmbiandou:
Donc merci pour le tuto... mais sans grande surprise cela a fonctionné parfaitement.
Donc j'ai modifier le web.xml et le fichier de Spring afin d'ajouter ma conf petit à petit mais au final pas de soucis... donc je ne pense pas que cela vienne de ma conf.
Après j'ai fait le test inverse:
j'ai ajouter le code suivant dans mon index.jsp (avec les import qui vont bien):
1 2 3 4 5 6 7 8 9 10 11 12
| <%
if(SecurityContextHolder.getContext() == null){
System.out.println("SecurityContextHolder is null");
}else{
System.out.println("SecurityContextHolder not null");
}
if(SecurityContextHolder.getContext().getAuthentication() == null){
System.out.println("Authentication is null");
}else{
System.out.println("Authentication not null");
}%> |
et là dans ma console, j'ai le résultat suivant:
1 2
| SecurityContextHolder not null
Authentication is null |
Mais je ne vois pas pourquoi mon authentication est null... puisque cela fonctionne dans le tuto...
Je continue à chercher mais si vous avez une idée, n'hésitez pas
Merci à tous encore.
Partager