Grails: Getting the current view of a name from Taglib

Is there a way to find out the current file (or gsp file) that is being evaluated?

RequestURI does not work due to URLs and referrals.

I am trying to get resources dynamically based on the current GSP file. For example, if the product /view.gsp is running, I want to include product / view.css and product / view.js (if they exist). The part that I'm having a problem with is the text "view"

+7
view grails gsp taglib
source share
1 answer

The gsp page is compiled into a class derived from org.codehaus.groovy.grails.web.pages.GroovyPage . You can get the whole path to the gsp file with ${this.getGroovyPageFileName()} or just ${groovyPageFileName} . You must trim the path information yourself.

+8
source share

All Articles