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

Mitch,

On 4/28/14, 3:16 PM, Mitch Kyle wrote:
> In a ServletContextListener of my webapp 
> "ServletContext.getRealPath("/path")" is called. The path is valid
> and exists.
> 
> With servlet-api 3.0.1, this returns null. In 3.1.0, it returns
> the expected result.

The API JARs themselves shouldn't affect anything: in this case, they
are just interfaces with Tomcat-specific implementations under the covers.

> So, is servlet-api 3.1.0 needed to run webapps on Tomcat 8.0.5? And
> if so was there a breaking change between the two versions?

Each Tomcat version ships with the proper version of its spec API JAR
file. All versions of the spec API (and implementation!) should allos
getRealPath to work properly.

> I ask because this could affect my ability to run the app on tomcat
> 7.

Are you saying that Tomcat 7 does not work and Tomcat 8 does work? Or
were you moving JARs from one version to another?

Are you sure there are no other differences between your environments?
GetRealPath will not work if your WAR file has not been expanded (and
is one of the many reasons why it should not really ever be used). Is
it possible that is the case (no expanded WAR) where getRealPath
returns null?

I've never known there to be any problems with getRealPath() (other
than the obvious problems with its existence in the first place).

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: GPGTools - http://gpgtools.org
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQIcBAEBCAAGBQJTX8Z6AAoJEBzwKT+lPKRY8XAP/2cqQogqHjkxoZutAq+he9Lh
JejDRY3LI8dXlVbuMGWVzT5XewBLR3gU0YgbCe4H6ImlTfJue19mxo14pWSr0xCB
BxBz/klp8H7bAbAddY9AjuniRcPQARptNhf/HYzPhXmYXKb10wUs0JEvAh4WFbuQ
ywC8zEFTKmI0+fOFwd9eL+9UsKQ/+u0cOEY+FBXihGdHMIuJ5W+kGfXTrj98vtf3
gj7x3vBkrDIsYMS26oTYEkepEE9S+9ZweG74YczDpz7jWnI1YLc+HOvla5aO6apA
o2gdnCnNUvoupK6ucugJ/Z6FAJzmDPyc8+hqP6OjaXi7q2ICOyNXAEwK0LjwUSgH
MpjeRdwyi8H2sLRWpn+79i6z2ZAXxrzV/10MD82lt+D+CCBYtdyOaA1/JVJZ9BEh
JDYlCG8jCz8yqRb/4plaNiBJrQr27vEPoXwmzQtq5B0PyV9mYh6ME7CKVz5O0axw
RMjSIKcBOthIlKdvnjVcVGkOclvS2+KCx/WV1V6dEYd35/FLs5d5Uqs2uUhxXHw8
27o7tmyACVYu9nvn/MlrP34zb5eVtH9LH5IcrhMVFV73/fHQyIOATYH67ZPm9fsD
iXxyAxtwQLu0uvJDmZ8kBQW0nLw7zLVapeB48geVgokQqczWHWqstk3rqG1CjXuK
nXDO7Ns+5bOJGywVz/X/
=3Ibm
-----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