How to find the physical path of a GSP file in a deployed grails application -


I need to know the physical path of a grails GSP file.

My requirement is that I want to create a new layout file at run-time and want to use it in that application.

I have been able to get this problem without any problem when the application runs on the Grails Run-Ape, however, when I deploy the App on Zebus, that path On which files need to make changes.

So, ideally, I would like to search at runtime (some main.gsp layout file) using some magical utility on the way to a particular GSP and I need to create my new layout in the same directory Main.gsp live

any hint?

--Depak

Here is the layout in the production environment - to view the folder path Some groovy codes (eg. When jboss was deployed as a war):

  import org.codehaus.groovy.grails.commons.ApplicationHolder ... file layoutfolder = ApplicationHolder.application .parentContext.getResource ("WEB-INF / grails-app / view / layout") File def absolutePath = layoutFolder.absolutePath println "full path to layout folder: $ {absolutePath}" file newLayoutFile = new file (layoutfolder, "foo.gsp")  

use of newly created layout To do this, you will need to restart the web-application or container, as it is checked in production mode.


Comments