Jump Into Grails 2.0
Do you hate reading? Well today is your lucky day because instead of reading a post, you can watch my first ever Grails screen-cast! It’s definitely a little rough around the edges though and you’ll have to watch it full-screen otherwise the text will be too small.
The topic is “Jumping into Grails 2.0″ using the spring-security-core and resources plugins as well as some unit testing. Please let me know in the comments if you find the screen-cast valuable or not.
Jens:
January 6th, 2012 at 12:33 am
Great intro to version 2. Thanks.
Domingo:
January 6th, 2012 at 5:58 am
Great – I’ve learnt a few things from your screencast. Thanks.
Michael:
January 6th, 2012 at 2:38 pm
Very cool – thanks for the effort! I’ve also learned a lot. Could I submit a wish for an ACL tutorial? Thanks – Michael
bronoman:
January 7th, 2012 at 7:01 am
Thank you very much. Awesome work! Your intro to spring security convinced me to persue this avenue in my grails project.
Juha Vainikka:
January 7th, 2012 at 3:23 pm
Good stuff! Keep ‘em coming Bobby.
Ray Tayek:
January 7th, 2012 at 9:44 pm
any chance of posting the code. i have poor vision.
thanks
John Wagenleitner:
January 8th, 2012 at 11:56 am
Great screencast, very informative and nicely paced. If not already in the works, would be great to have it linked to from the Grails screencasts page at http://grails.org/Grails+Screencasts.
An Army of Solipsists » Blog Archive » This Week in Grails (2012-01):
January 9th, 2012 at 8:39 pm
[...] Bobby Warner’s published a great screencast this week on using Grails 2.0 and Spring Security – Jump Into Grails 2.0 [...]
» Blog Archive:
January 10th, 2012 at 2:32 am
[...] Bobby Warner ha pubblicato uno splendido screencast questa settimana su come usare Grails 2.0 e Spring Security – Jump Into Grails 2.0 [...]
bobby:
January 10th, 2012 at 7:53 am
@Michael, Sure, I can look into doing an ACL screencast at some point in the future.
bobby:
January 10th, 2012 at 7:53 am
@Ray, Sure, I can put the code on GitHub if you’d like. I’ll update the post with the GitHub repo URL when I have it up there.
bobby:
January 10th, 2012 at 7:54 am
@John, I tried to put in on the grails.org screencast past, but ran into an issue with the form. I posted to the Grails mailing list and hopefully I’ll be able to put them up there soon. Thanks!
GroovyMag - the magazine for Groovy and Grails developers about Groovy programming and Grails development:
January 10th, 2012 at 8:01 am
[...] Jump Into Grails 2.0 [...]
Mahboob:
January 14th, 2012 at 2:44 am
Hi Bobby,
Many thanks for your great posts on this site.
Where I really need help is -
I want to add User Registration and Forgot Password functionality to my login module. I have followed your previous screencast and built the login functionality using grails spring-security-core.
The grails spring-security-ui didn’t work for me. With grails 2.0 spring-security-ui does not render the login button, and with grails 1.3.7, it renders an extra button. I don’t want to go back to grails 1.3.7 just to make spring-security-ui work and then land up with a shabby extra button.
So, what would work for me is to just pull out the “User Registration” and “Forgot Password” functionality out of spring-security-ui and latch it to my project. As a starter, if you could provide what files I need, it will be very helpful. Probably you could do a screen cast on this issue.
I’m thinking that there will be many people in my situation. For all of us, what I am requesting you will be a work around until a bug-free, robust spring-security-ui plugin is released.
Cheers,
– MH
bobby:
January 15th, 2012 at 8:09 am
@Mahboob I’ll think about possibly doing an additional screencast on security in the future as there was a request for the ACL plugin too.
Specifically for your question about spring-security-ui, you will want to look at this code: https://github.com/grails-plugins/grails-spring-security-ui/blob/master/grails-app/controllers/grails/plugins/springsecurity/ui/RegisterController.groovy
bobby:
January 15th, 2012 at 8:11 am
@John, All my screencasts are now up on grails.org. There also is going to be an update to the site to fix the error I was facing.
Mahboob:
January 16th, 2012 at 5:17 am
Hi Bobby,
I took the RegisterController.groovy as per your suggestion, and noted the dependent files as:
AbstractS2UiController.groovy
RegistrationCode.groovy
messages.spring-security-ui.properties
DefaultUiSecurityConfig.groovy
I created the correct directory structure in my project as per the package declarations, and saved the files in those directories.
grails throws the following error:
No signature of method: groovy.util.ConfigObject.contains() is applicable for argument types: (java.lang.String) values: [$]
Possible solutions: containsKey(java.lang.Object), containsKey(java.lang.Object), toString(), toString(), toString(), toString(). Stacktrace follows:
Message: No signature of method: groovy.util.ConfigObject.contains() is applicable for argument types: (java.lang.String) values: [$]
Possible solutions: containsKey(java.lang.Object), containsKey(java.lang.Object), toString(), toString(), toString(), toString()
Line | Method
->> 138 | doCall in grails.plugins.springsecurity.ui.RegisterController$_closure4
Line 138 of RegisterController.groovy is an if condition:
def conf = SpringSecurityUtils.securityConfig
def body = conf.ui.forgotPassword.emailBody
if (body.contains(‘$’)) {
How do I fix this error?
Cheers,
– MH
bobby:
January 16th, 2012 at 11:22 am
@Mahboob, Please ask this specific code issue on the Grails user list as it’s outside the scope of this screencast. Thanks!
Steve:
January 18th, 2012 at 4:18 am
This was fantastic… I wish it had been around a month ago when I started into spring security and grails for the first time with no idea what I was doing, and some vague pointers from people who’d used Grails 1.3. Thanks heaps
batman:
February 8th, 2012 at 4:32 am
great article – thanks bobby. i’m just starting out with grails, and this is an excellent resource for me.
btw – did you ever get around to posting the source code?
bobby:
February 13th, 2012 at 8:13 am
@batman, thanks for the feedback. Glad you liked it. I forgot to post the code, but I’m planning an extension screen-cast to add more security features and I’ll make sure I post the code for that one (which will also have everything from this one).
bobby:
February 23rd, 2012 at 1:49 pm
You can get the code here: https://github.com/gr8casts/episode-001
olivier nguyen:
April 19th, 2012 at 11:28 am
Hi, I see you are using a TextEditor. Can you debug a Grails app with Textmate or SublimeText 2?
Is working with a text editor and the command line the most popular way to develop an app with Grails 2?
bobby:
April 23rd, 2012 at 6:03 pm
@Olivier I like using just a text editor and command line, but I would say it’s probably more common to use an IDE like SpringSource Tool Suite (based on Eclipse) or IntelliJ IDEA.
Chris:
May 17th, 2012 at 12:54 pm
Is there anything special that needs to be done to get the modules in ApplicationResources to render in Internet Explorer? Page loads with Invalid character errors…
bobby:
May 21st, 2012 at 11:39 am
@Chris No, there shouldn’t be anything special needed for IE. I have not run into any issues specific to IE before. If you seeing weird errors, please post on Mailing List so we can help get them resolved! Thanks.
Bryn:
July 5th, 2012 at 5:55 am
Great screencast Bobby. Really clear and nicely paced.
Shantanu:
September 24th, 2012 at 10:22 pm
I’m using Grails 2.0.4 and the command ‘grails’ is not recognised in terminal in the directory you specified… is there any solution or am I doing it wrong?
Shantanu:
September 24th, 2012 at 10:22 pm
ps: I’m using mac osx
Alan:
February 21st, 2013 at 5:52 pm
That is nice material. Good hands on with Spring Security.