grails / grails-core

The Grails Web Application Framework
http://grails.org
Apache License 2.0
2.79k stars 949 forks source link

Can I access directly to the *.gsp pages without go through controllers in Grais-3.0.1 #679

Closed ava305 closed 9 years ago

ava305 commented 9 years ago

I want to directly access *.gsp pages in a project. and I read the FAQ (https://grails.org/wiki/FAQ#Q: Can I view my GSP's (Groovy Server Pages) directly?) gives the yes answer.

But I have not succeed to directly access any .gsp pages under grails-app/views. I only get the source code of the page by the browser if I put some .gsp pages under the src/main/webapp folder.

How can i should do to access directly to the *.gsp pages?

ava305 commented 9 years ago

I just do a workaround for this: "/**.gsp"(controller:"staticViews")

StaticViewsController: class StaticViewsController {

def index() {
    render (view: request.requestURI)
}

}