In Grails 2.x, to allow following symbolic links, we can add following in the scripts/_Events.groovy
:
eventConfigureTomcat = { tomcat ->
def ctx = tomcat.host.findChild("")
ctx.allowLinking = true // Follow soft links
}
How can we achieve the same in Grails 3? I've tried creating the same script file in src/main/scripts
directory in Grails 3 but didn't help.
Edit:
I also tried adding following line in Bootstrap.groovy
:
Holders.getServletContext().allowLinking = true
Finally, I've figured out the solution for following symbolic link in Grails 3 with the help of examples provided by graemerocher.
You just need to add the following to your
./grails-app/init/<package>/Application.groovy
:Packages to import: