gswg-v2
gswg-v2 copied to clipboard
Problems with URLs and Controllers
Hi. First of all, I want to thank you for your delightful Grails book. I was really enjoying it but I am having some problems in the Security chapter. You know this chapter deals with authentication and we need to create a login.gsp file and we have to add some code to the UserController file (the authenticate closure). The app runs without errors but when I try to access to http://localhost:9090/racetrack/user/login I get the following Apache Tomcat error:
HTTP Status 404 - /racetrack/user/login type Status report message /racetrack/user/login description The requested resource (/racetrack/user/login) is not available.
So I changed it to http://localhost:9090/racetrack/user/login.gsp (I added the .gsp extension to login) and I can access to the login view. But when I enter some information to the login and password fields and press Login I get the following error:
HTTP Status 404 - /racetrack/user/authenticate type Status report message /racetrack/user/authenticate description The requested resource (/racetrack/user/authenticate) is not available.
It seems that Grails is looking for an authenticate controller instead the authenticate closure. I am a Grails beginner so I might be wrong but I am doing all that your book says. Or is it a version issue? I am using Grails 1.3.7
I am sorry if I am using this medium as a forum but maybe my problem could help to many fans of your book.
Thanks.
try