You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Hawkins, Keith (Keith)" <kp...@avaya.com> on 2001/02/05 21:26:49 UTC

Rules regarding opening files in JSP pages served by Tomcat


Hello,

I have a JSP based application for which the JSP files reside in directory
C:\tomcat\jakarta-tomcat\webapps\myapp.
One of the JSP files is trying to open a config file configs.xml which also
is present that directory. The JSP code  is using
request.getRealPath("configs.xml") which returns
C:\tomcat\jakarta-tomcat\webapps\myapp\configs.xml to resolve the actual
location of the configs file.   Yet when the code tries to open this file it
says that C:\tomcat\jakarta-tomcat\webapps\myapp\configs.xml is not found.
But IT IS there.  So why can't it see the file?   Are there rules which
prohibit accessing a file in this directory.  How do I grant access to this
directory?

I am able to load the file if I place it in  C:\tomcat\jakarta-tomcat\bin
and skip the use of the request.getRealPath call.  But that is not a nice
solution. I would like the config file to reside with the JSP files it
relates to.  How can I accomplish this?

Thanks,
Keith