incubator-jspwiki-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Burch <br...@PingToo.com>
Subject Re: Displaying images outside the webapp container
Date Fri, 05 Dec 2008 10:32:32 GMT
Hassan Schroeder wrote:
> Brian Burch wrote:
> 
>> This a known tomcat issue - that it will not follow a symlinked 
>> directory by default. 
>> http://tomcat.apache.org/tomcat-5.5-doc/config/context.html
>> says to define a context.xml in the webapp META-INF directory. Mine 
>> simply contains <context allowLinking="true"/>, because the 
>> documentation recommends NOT specifying docBase.
> 
> Is that a typo? Because it's <Context..., not <context...

You are correct. Tomcat/jspWiki are running on another machine and I was 
too lazy to copy the file to this one. My live file has <Context 
allowLinking="true"/> (i.e. without docBase).

>> INFO: default: DefaultServlet.serveResource:  Serving resource 
>> '/files/pictures/2008/11-lateAutumn/DSCF2686.JPG' headers and data
>>
>> This looks suspicious to me - the url has a leading slash, rather than 
>> relative to the webapp docBase, and tomcat doesn't serve up the image 
>> file! Presumably, I've missed an important detail.
> 
> You did say the 'view source' URL was correct, yes?

The view source shows me this section of html inserted by the ImagePlugin:-

<p>Try to get a thumbnail via my new symlink...
<table border="0" class="imageplugin" style="margin-left: auto; 
margin-right: auto;">
<tr><td><a href="files/pictures/2008/11-lateAutumn/03112008016.JPG"><img

src="files/pictures/2008/11-lateAutumn/.ginp/100-03112008016.JPG" 
/></a></td></tr>
</table>

</p>

The DefaultServlet logs that it has inserted a leading forward slash, 
but I now think this is misleading.

I created two folders side by side. files/pictures/ is a symlink and 
files/pictures-local/ is a real folder. View source for both image urls 
is equivalent (both without leading slash), and the DefaultServlet log 
entries are also equivalent (both with leading slash). The only 
difference is that the non-symlink image displays while the symlink one 
does not.

I think the most likely explanation is that my META-INF/context.xml is 
applied to the jspWiki webapp, but tomcat is scheduling the 
DefaultServlet to find the image. If I am right, I will need to apply 
allowLinking to the DefaultServlet, or possibly the entire tomcat Host.

Thanks for your comments.

Brian



Mime
View raw message