web applications - Access json file in web app folder from gsp grails? -


i have json file called flare.json in web-app folder of grails application.

i have gsp called test.gsp in folder called reports views folder.

i have script in test.gsp needs take json file input can't seem access it.. i've tried several different ways have had no luck far. example i'm looking @ uses following line :

d3.json("flare.json", function(error, data) { ..... 

i have tried same , several other variations keep getting 404 errors saying resource can't found. i'm new @ grails. have missed something?

you can try g.resource create link json file.

d3.json('${g.resource(file: "flare.json")}', function(error,data){}); 

Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

What is the difference between data design and data model(ERD) -

ios - Can NSManagedObject conform to NSCoding -