문제

I created a new grails application using grails 2.3.7 and I removed the index action from the controller. My controller has static scaffold = true So now when I try to access applicationname/controller/index I get the list of objects which was shown by the list action in earlier versions of grails.

It has become confusing now, How do I redirect my applicationname/controller/ to some other action, because now I cannot do the following -

def index() {
redirect(action: someotheraction)
}
도움이 되었습니까?

해결책

You can assign a value to the defaultAction property. See http://grails.org/doc/2.3.x/ref/Controllers/defaultAction.html.

I hope that helps.

다른 팁

you can use following to keep the url same as applicationname/controller/ but still forward request to a different action


def index() {
forward(action: someotheraction)
}

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top