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 implements an interface and then implementing in the settings resources. Groovy

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 class SpringSecurityService IGService for example {/*...*/}

  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

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -