History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: GRAILS-1061
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Graeme Rocher
Reporter: Sergey Nebolsin
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Grails

"redirect()" dynamic controller method works wrong with reverse url mappings

Created: 23/Apr/07 06:33 AM   Updated: 21/May/07 08:08 AM
Component/s: Controllers
Affects Version/s: 0.5-RC1
Fix Version/s: 0.5-RC1

Time Tracking:
Not Specified


 Description  « Hide
"redirect()" dynamic controller method works wrong with reverse url mappings.

Specifically, if we have closure generated by default scaffolding:

    def index = { redirect(action:list,params:params) }

it will always redirect to "/controller/list?" even if we have special url mapping for such controller:

class EssUrlMappings {
    static mappings = {
        "/admin/$controller/$action?/$id?" {
            constraints {
                id(matches:/\d+/)
            }
        }

//        "/$controller/$action?/$id?" {
//           constraints {
//                id(matches:/\d+/)
//            }
//        }
    }
}

I expect '/admin/controller/list?' here.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Graeme Rocher - 23/Apr/07 08:46 AM
fixed, please re-test and close if you're happy

Sergey Nebolsin - 23/Apr/07 09:14 AM
Unfortunally, I'm still not happy.

Now I have following exception at any <g:link>

at ApplicationTagLib at line "def url = mapping?.createURL(params)"

java.lang.NullPointerException at org.codehaus.groovy.grails.web.mapping.RegexUrlMapping.createURL(RegexUrlMapping.java:177) 

Looks like it doesn't check null params.

And redirect() doesn't work also (it still redirects to '/controller/list' instead of '/admin/controller/list')


Sergey Nebolsin - 23/Apr/07 01:36 PM
Works for me now. Thank you.

Sebastian Munz - 21/May/07 08:08 AM
I am sorry, but I have the excactly same problem with Grails 0.5 FINAL. It is always looking for the "/$controller/$action?/$id?" line. Was this really fixed in 0.5 RC1?