I am using spring security for a project (spring+hibernate) with database authentication.
If the user attempts to go to a secured page, he is redirected to the login form but he does not go to the earlier requested page even though this is the documented default behavior.
I have provided relevant sections of web.xml, root-context.xml and spring-security.xml
I am using spring 3.0.5.RELEASE
web.xml
Code:.... <context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/spring/root-context.xml /WEB-INF/spring/security/spring-security.xml </param-value> </context-param> <!-- Create the Spring security filter --> <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> ...
root-context.xml
Code:<security:global-method-security secured-annotations="enabled"></security:global-method-security>
spring-security.xml
I have tried with and without the always-use-default-target. I can only guess that I am overriding something so this property is not taking effect.Code:<security:http auto-config="true" use-expressions="true" access-denied-page="/auth/denied" > <security:form-login login-page="/auth/login" authentication-failure-url="/auth/login" default-target-url="/mydefaultpage" always-use-default-target="false"/> <security:logout invalidate-session="true" logout-success-url="/auth/login" logout-url="/auth/logout"/> <security:session-management invalid-session-url="/auth/login"/> </security:http>
Thanks in advance.


Reply With Quote