I am working with Grails 2.4.2. I am saving images to a directory named gameImage under web-app folder. It's working perfectly in development mode. But when I run the war on localhost in the xampp server then in the view image is not showing but saving in the directory. Here are my attempts below ::
In my config file >>>
gameImage.location = "web-app/apps/gameImage/"
In my controller where saving image >>>
String fileName = grailsApplication.config.gameImage.location.toString() + distGameInstance.packageName + '_' + newGameImage.getOriginalFilename()
new File( grailsApplication.config.gameImage.location.toString() ).mkdirs()
newGameImage.transferTo( new File( fileName) )
In my view where I want to show the image >>>
<g:each in="${distributedGameListInstance}" status="i" var="androidDistGameInstance">
<div class="col-lg-3 col-md-4 col-xs-6 thumb" >
<a class="thumbnail" href="#">
<g:img uri="${resource(dir: "apps/gameImage", file: "${androidDistGameInstance.imageName}")}" style="height: 120px;width: 120px;" />
</a>
</div>
</g:each>