Hi everyone!
I am using Spring Security in a pretty simple web application (find the web.xml + applicationContext-security.xml below). It works pretty well, login / logout / login-error etc. ... The problem I am facing is, that I cannot debug my application when using Spring Security in eclipse. I disabled the filter-stuff in web.xml and debugging works fine, but then the security wouldn't work. Is that something special caused by my setup or is that the general behaviour?
I tested this with:
eclipse 3.3 + 3.5
Tomcat 5.5 + 6.0
Java 1.5
Spring Security 2.0.5
Spring 2.5.6
Problem for me is in that way I can't debug Servlets that I wanna use and the jsf beans I am using. Any help / comments is welcome! Thanks!
web.xml:
applicationContext-security.xml:Code:<context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/applicationContext-security.xml </param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <listener> <listener-class> org.springframework.web.context.request.RequestContextListener</listener-class> </listener> <!-- Filter Config --> <filter> <filter-name>springSecurityFilterChain</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> </filter> <!-- Filter Mappings --> <filter-mapping> <filter-name>springSecurityFilterChain</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
Code:<?xml version="1.0" encoding="UTF-8"?> <beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.1.xsd"> <http> <intercept-url pattern="/jsf/login.xhtml" filters="none" /> <intercept-url pattern="/jsf/secure/**" access="ROLE_ADMIN" /> <form-login login-page="/jsf/login.xhtml" authentication-failure-url="/jsf/login-error.xhtml" /> <logout invalidate-session="true" logout-success-url="/jsf/downloads.xhtml" /> </http> <authentication-provider user-service-ref="userDetailsService"> <password-encoder hash="md5" /> </authentication-provider> <authentication-manager alias="authenticationManager" /> <beans:bean id="authenticationProcessingFilter" class="org.springframework.security.ui.webapp.AuthenticationProcessingFilter"> <beans:property name="authenticationManager" ref="authenticationManager" /> <beans:property name="authenticationFailureUrl" value="/jsf/login-error.xhtml" /> <beans:property name="defaultTargetUrl" value="/jsf/secure/connections.xhtml" /> <beans:property name="filterProcessesUrl" value="/app/jsf/j_spring_security_check" /> </beans:bean> <beans:bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <beans:property name="driverClassName" value="org.sqlite.JDBC" /> <beans:property name="url" value="jdbc:sqlite:path\to\filedb.db" /> <beans:property name="username" value="username" /> <beans:property name="password" value="password" /> </beans:bean> <beans:bean id="userDetailsService" class="org.springframework.security.userdetails.jdbc.JdbcDaoImpl"> <beans:property name="dataSource" ref="dataSource" /> </beans:bean> </beans:beans>


