grails - Injecting a SpringSecurityService into a Java class -
When we modify it, we note that one service should implement the interface, then, Java class this interface Will depend on.
But, what about Grails-service that is a built-in service or is there a ready plugin available?
How to let go
i.e.:
The following is not the IoC pattern because the person.java class depends on the class not on the interface:
import Do the grails.plugin.springsecurity.SpringSecurityService; Class person {spring security ss; }
The following IoC pattern is: If we apply the
import grails.facade.IGService class person {IGService sss; }
Then, in resources.groovy
, we have:
person (slm.abdennour.Person) {sss} = SpringSecurityService}
I am getting the solution, and I want to share it:
Import grails.plugin.springsecurity.SpringSecurityService; Import grails.facade.IGService; Class Customer SSS SpringSecurityService applies to IGService {}
then, in resources.groovy
:
springSecurityService {CustomerSSS} { ('UserDetailsService'
Comments
Post a Comment