You need to pass your variable as part of the model using the render method in your controller action, for example:
String uploadLocation = grailsApplication.config.uploads.location render(model: [uploadLocation: uploadLocation])
Then in a view that you can simply do:
<td> <input type="text" value="${uploadLocation}/${fileResourceInstance.decodeURL()}"/> </td>
On the other hand, if this is the value defined in Config.groovy, you can also do this in your gsp:
<%@ page import="org.codehaus.groovy.grails.commons.ConfigurationHolder as CH" %> <td> <input type="text" value="${CH.config.uploads.location}/${fileResourceInstance.decodeURL()}"/> </td>
For more information check out the Grails docs .
Maricel
source share