I just started to learn Spring Security and have some trouble. I want to configure User login on page with password and username which stored in database during registration
<security:http auto-config="true">
replace this section with the following:
<security:http auto-config="true" use-expressions="true">
Note:
As a side note i see from the code and from comment i doubt you have injected SessionFactory from GuestBookDAOImpl, thats causes NPE upon method call on the DAO layer. Inject it either from xml config or annotations.
Bean creation error for "org.springframework.security.filterChains" comes when you are using spring version higher than 3.1 and have not added dependencies manually for spring-aop, spring-jdbc, spring-tx and spring-expressions in you POM.xml.
Reason : If don't do so, maven automatically downloads older version jars (3.0.x) for these artifacts which conflict with newer version spring security jars.
use use-expressions="true"
along with auto-config="true"
<security:http auto-config="true" use-expressions="true">
<security:intercept-url pattern="/user/*" access="hasRole('ROLE_USER')"/> </security:http>