-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Ted,

On 6/6/19 08:50, Milbaugh, Theodore K (Ted) wrote:
>> -----Original Message----- From: Christopher Schultz
>> <ch...@christopherschultz.net> Sent: Wednesday, June 5, 2019 4:37
>> PM To: users@tomcat.apache.org Subject: [EXTERNAL] Re: Making
>> PreResources configuration recurse directories
>> 
>> Nationwide Information Security Warning: This is an external
>> email. Do not click on links or open attachments unless you trust
>> the sender. 
>> ---------------------------------------------------------------------
- ---------
>>
>>
>> 
- -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA256
>> 
>> Theodore,
>> 
>> On 6/5/19 15:16, Milbaugh, Theodore K (Ted) wrote:
>>> I am using Tomcat version 9.0.12
>>> 
>>> I have a PreResources tag in my context.xml like this:
>>> 
>>> <Resources 
>>> className="org.apache.catalina.webresources.StandardRoot"> 
>>> <PreResources 
>>> className="org.apache.catalina.webresources.DirResourceSet" 
>>> base="C:\\good_files\\goodies_in_here" internalPath="/" 
>>> webAppMount="/" /> </Resources>
>>> 
>>> This works great, in that if I access a JSP like this:
>>> 
>>> http://localhost:8080/candy/chocolate.jsp
>>> 
>>> I am able to access the JSP with no issues. However, there are 
>>> subdirectories in C:\good_files\goodies_in_here. If I try to
>>> access a JSP in a subdirectory:
>>> 
>>> http://localhost:8080/candy/crunchy/peanut_brittle.jsp
>>> 
>>> I get a 404, even though the file 
>>> C:\good_files\goodies_in_here\crunchy\ peanut_brittle.jsp
>>> exists. Do I have to create a PreResources tag for each
>>> subdirectory in my tree?
>> 
>> What you are doing is expected to work. It doesn't map a single
>> directory and its (non-directory) contents into a single
>> directory. It grafts entire trees into the URL space.
>> 
>> It may be a copy/paste error, but I see a space between your
>> "crunchy/" and "peanut_brittle.jsp" strings. It should not
>> matter, but if you replace "\\" in your configuration with "/",
>> does that improve things?
>> 
>> I would caution you about the use of <PreResources>. If there is
>> for example a WEB-INF/web.xml file in there or WEB-INF/classes,
>> then those will be loaded before the web application's "normal"
>> files are loaded, which may be surprising.
>> 
>> - -chris
> 
> Chris: I might have been seeing a permissions error. I copied all
> of the resource files to a local directory, and everything is
> working as expected now.
> 
> Thanks for your advice, I changed my configuration to a 
> PostResources tag, and used forward slashes > for my directory 
> specification.

Glad you got things working. And welcome to the mailing list.

- -chris
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iQIzBAEBCAAdFiEEMmKgYcQvxMe7tcJcHPApP6U8pFgFAlz6c+0ACgkQHPApP6U8
pFggqhAAlzF24QYH4gXJaPaf3/ZVSMNGPgFF+h80uw0mkste630URocdRu/6noFh
WOBMQTRuFCYMvTAlv7pZ6v0WEamkU7MZJs68eOxeCxcCAAdS0qx3wbMZz7rVrWFp
EKjIhHmfwmPgZ3enlEEB+mjZN1/e75lg/Z6g07uJZHR2GBgO7h9X9Fn2E9elI056
zdDhl9l/EWHyfmoZz3gLX+zen6yTXhyBv+cXarjYxpk65mU2kDkUcNH7l3s3p9Th
XsOQpd16/0TD+82XEo1XUjy+l/Ogwdc3MY2PwcQp0m3Ewpz5maXpKCas0d2Uc4sd
E2MSN1Vlj4wBAQ78GMXgoSnsFAiQ4bsTSmkc8Vlwjz8YgrPm/wH0RJ/AX0D4gsdf
ABJ/vQH/lgEvz47nlxqVnGFYPHmi/h+ZmIHQNvzTo3l9JkK0/XYsavYNnL1U9bNh
sipqo+mJmX4H+KPy9nuWQ0ZDyxwu2ZozHYmdVasIKUf4LEMxOZ54E2RKZ8muiIlI
xbkVJ1gtHLTqCaslSenEYsL6juk+cgGocOcwek1yikfxdXZ/Z4WlldJZvcRslL6Z
gvoP8zvA9mlvx7JmLXTflMl4AuxKs+x9wipJU0dRgo6k6luAEQNebOYfKe4HXusO
yoV8iJz7i+jyXGQ9RyOguV2zAQwDDKre64GknldBVrrZiMVMHu0=
=azGW
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to