Hello,

I am running Tomcat 8.5.15 on Windows 10.

I have a folder called "myapp" with my web application files inside of it.
Inside ${tomcat_base}/conf/Catalina/localhost I have my configuration file
"other.xml" with the following entry:

<Context docBase="{full path to the myapp folder}">
</Context>

The index.html file lives inside myapp/client with the following text:

<a href="file1.txt">text file 1</a>
<a href="/file2.txt">text file 2</a>

file1.txt also lives inside myapp/client
file2.txt lives inside myapp

The html file is then accessed by going to http://locahost:8080/other/client.
When clicking the "text file 1" link it correctly finds the file under
http://localhost:8080/other/client/.  When clicking on the "text file 2"
link unfortunately it looks for it under http://localhost:8080/, and it is
not found.  I was hoping since the path to file2.txt starts with a '/' it
would look for it under the context root http://localhost:8080/other/, but
unfortunately it seems to look for it under the base webapps folder.  Is
there a way to have a path refer to the context root of my application
without specifically adding the context root in there?

Thank you,

Jesse

Reply via email to