installing spring security ui plugin
steps to be performed for grails 1.3.7
- grails install-plugin spring-security-core
- grails s2-quickstart com.myApp SecUser SecRole
- grails install-plugin spring-security-ui
- grails s2ui-override auth
- grails s2ui-override layout
- grails s2ui-override user com.myApp
- grails s2ui-override role com.myApp
- edit springSecurityUI.gsp which is generated in views/layout
- add “plugin:’spring-security-ui'” as an attribute of resource of href of link taglib
- add “plugin=’spring-security-ui'” as an attribute of javascript taglib of jquery resources
- remove “plugin=’spring-security-ui'” attribute from renderTemplate taglib at bottom
- edit _ajaxLogin.gsp template which is generated in views/includes
- add “plugin=’spring-security-ui'” as an attribure of javascript taglib of jquery.form.js and ajaxLogin.js
for grails 2.0.0 there are more steps to be performed:
- edit springSecurityUI.gsp:
- add the <r:layoutResources /> in springSecurityUI.gsp in the head and at the end of body (see http://grails-plugins.github.com/grails-resources/ref/Tags/layoutResources.html)
- replace the <g:javascript library=”jquery” plugin=”jquery” /> with <r:require module=”jquery-ui”/>
- edit AbstracS2UIController.groovy of spring-security-ui plugin
- comment the declaration of grailsApplication property as of it does not required by grails 2.0 (otherwise exception will be thrown)
Advertisements
also, in Grails 2.0, you need to add a “String email” in SecUser.
And edit register.gsp layout.
Also, comment:
user.password = springSecurityService.encodePassword(params.password, salt)
for save and edit in plugins/springsecurity/ui/UserControler.groovy
and comment also password encoding in plugins/springsecurity/ui/RegisterControler.groovy
Great post, thank you for the post. I am getting this error.
Could you please shed some light. Thank you so much!
org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error applying layout : register
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
java.lang.Thread.run(Thread.java:662)
root cause
org.codehaus.groovy.grails.web.pages.exceptions.GroovyPagesException: Error processing GroovyPageView: Error executing tag : No module found with name [jquery-ui]
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
java.lang.Thread.run(Thread.java:662)