javascript - File under views not accessible in grails -


we need use javascript license file commercial javascript library using in our grails application. license needs placed in same folder view, since doesn't support relative paths specification license file. our view located in grails-app/view/video. when put license file in folder can't access in browser like.. app-url/video/license.txt whereas when place in other folder, say: "../assets/libray/license.txt" able access through browser using url app-url/assets/library/license.txt

since relative paths not supported js library, we're unable use technique.

is there way access file located under views folder through url ? or there specific configuration setting required done ? suggestion , comments appreciated.

thanks

unless configure environment , map static files there have no other option setup urlmapping.groovy , serve static contents there. in urlmappings.groovy add:

"video/license.txt"(controller: 'view', action: 'license') 

and in view controller:

def license () {    def file = new file('/license.txt') // change this!    response.setcontenttype("text/plain")    response.outputstream << file.newinputstream()  } 

Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -