spring security with custom user details

后端 未结 3 1437
广开言路
广开言路 2021-02-04 20:09

I am trying to apply security in my spring application using database tables.

What I have so far in my applicationContext-Security is:



        
3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-04 21:04

    All dependencies of Spring Security (such as your DAO) should be decalred in the root web application context (applicationContext.xml or other XML files configured in named contextConfigLocation), not in serlvlet's conext (...-servlet.xml), because core Spring Security beans are declared in the root context, and beans in that context don't have access to beans in the servlet's context.

    If you use , you can follow this solution. See also:

    • Where do Spring configuration files go in a maven WAR module?

提交回复
热议问题