|
I'm trying to leverage the latest version of the Resources plugin in my application, but I'm confused about ad-hoc use of the <r:img> tag.
The images are served by Apache (we are using the Apache-Tomcat connector) and are located in the "images" directory relative to the server root. Up until this point, img tags in templates have worked fine with the format: <img src="/images/somedir/someimage.gif"/> However, if I use <r:img uri="/images/somedir/someimage.gif"/>I get an error such as: org.codehaus.groovy.runtime.InvokerInvocationException: java.io.FileNotFoundException: Cannot locate resource [/images/somedir/someimage.gif] Does the resources plugin only look for images in web-app/ when using <r:img>, or is there something else I'm missing? Any help would be appreciated. |
|
Ben,
You'll use r:img if you use tomcat to serve images... The plugin will not work on images that are being served outside (apache). We use it to serve application images, layout images, and css refered images... Other images that user upload, (that is stored outside web-app) are served directly, and not by the app (and plugin). []s, Lucas Frare Teixeira .·. - [hidden email] - lucastex.com.br - blog.lucastex.com - twitter.com/lucastex On Sun, Jan 2, 2011 at 8:46 PM, benfreefly <[hidden email]> wrote:
|
|
Thanks for the info. Just to clarify, when you say "use tomcat to serve images" do you mean r:img can only be used with images that are packaged with the war built by grails? Or is it possible to have another application in Tomcat whose only purpose is to serve images and the grails app could access those as well?
|
|
you can leave them out of the war if you use a virtual directory. Something like
<Context path=”/myimages” docBase=”/home/web/myimages” debug=”0″ privileged=”true”> </Context> in your resources.xml should work together with the plugin, without a second deployed app. |
|
Well I thought this had fixed the issue, but it turns out someone had changed my r:img tags back to just img on our testing server. So, I'm back to square one here. I do have a virtual directory for the images (although declared in tomcat's server.xml rather than resources.xml), but the resources plugin still seems to be unable to access them. Any other thoughts?
|
| Powered by Nabble | Edit this page |
