Hello I have scoured the web trying to get symlinks working for jsp pages
or folders in Tomcat 9 using Ubuntu 20.04. Here is how to repeat the issue,
and what I have tried.
1. Create a new folder in webapps, say "foo"
2. Put HelloWorld.jsp there
3. (I restarted Tomcat just in case) Verify it works at
localhost:8080/foo/HelloWorld.jsp
4. Put a soft symlink there: ln -s /opt/tomcat/webapps/foo/HelloWorld.jsp
/opt/tomcat/webapps/foo/Link.jsp
5. (restart) Verify that localhost:8080/foo/Link.jsp soft fails with
nothing in the log as if it does not exist.
WHAT I TRIED:
First I put this in the default host "localhost" in server.xml:
<Context path="" reloadable="true" docBase="foo">
<Resources allowLinking="true" cacheMaxSize="51200">
</Resources>
</Context>
<Context path="/ROOT" docBase="ROOT"/>
This achieves the objective of making "foo" the default so now I can just
use localhost:8080/HelloWorld.jsp
However "allow linking" is silently ignored. I also tried editing
context.xml and adding to the context:
<Resources allowLinking="true" />
<Resources cacheMaxSize="51200" />
Both of these solutions were gleaned from reading the documentation and
Google searches, and I seem to be stuck here.
For now I cannot install a later version of Tomcat (using Amazon Java 8
Coretto) or remove the symlinks as they are required by an existing
application.
Any thoughts are greatly appreciated.